Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0007095Openbravo ERPA. Platformpublic2009-01-23 12:282009-03-06 12:34
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
pi 
pi 
Core
No
0007095: Add onCreateDefault to AD_TABLE.classname column
The AD_TABLE.classname column is not-null therefore it requires an onCreateDefault definition. Below is a snippet of a chat with Asier on how to do that.

Probably: adding this the classname column in AD_TABLE.xml is enough:
        <onCreateDefault><![CDATA[NAME]]></onCreateDefault>

Skype chat:

Asier Lostalé: <column name="UIPATTERN" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
        <default><![CDATA[S]]></default>
        <onCreateDefault><![CDATA[CASE WHEN PROCEDURENAME IS NOT NULL THEN 'S' WHEN ISJASPER='Y' THEN 'S' ELSE 'M' END]]></onCreateDefault>
      </column>
[12:18:03] … it is a sql clause
[12:18:18] Martin Taal: ha ok in the ad_column
[12:18:31] Asier Lostalé: ?
[12:18:39] Martin Taal: no
[12:18:49] … where do you specify this then?
[12:18:59] Asier Lostalé: it should be in the xml that defines the ad_table table
[12:19:12] … in the classname column definition
[12:20:16] Martin Taal: so I need to add this manually to the xml?
[12:20:24] Asier Lostalé: yes
[12:20:31] Martin Taal: ok and then do create.database
[12:20:40] Asier Lostalé: :)
[12:20:50] Martin Taal: or can I create it directly in postgres to test it?
[12:20:52] Asier Lostalé: if you do create database you will not see anything
[12:21:04] … it is difficult to test
[12:21:10] Martin Taal: :-(
[12:21:23] … I mean where does DBSourcemanager place this code?
[12:21:26] Asier Lostalé: to test if you should remove phyisical column from db
[12:21:34] Martin Taal: in a trigger, a function, ...?
[12:21:45] Asier Lostalé: and then update.database
[12:22:12] … let's talk
[12:23:56] … select oncd from yourtable
[12:24:40] … name
No tags attached.
Issue History
2009-01-23 12:28mtaalNew Issue
2009-01-23 12:28mtaalAssigned To => mtaal
2009-01-23 12:28mtaalsf_bug_id0 => 2530904
2009-01-23 12:28mtaalRegression testing => No
2009-01-24 17:39svnbotCheckin
2009-01-24 17:39svnbotNote Added: 0012594
2009-01-24 17:39svnbotStatusnew => resolved
2009-01-24 17:39svnbotResolutionopen => fixed
2009-01-24 17:39svnbotsvn_revision => 12228
2009-03-06 12:34psarobeStatusresolved => closed

Notes
(0012594)
svnbot   
2009-01-24 17:39   
Repository: openbravo
Revision: 12228
Author: mtaal
Date: 2009-01-24 17:39:41 +0100 (Sat, 24 Jan 2009)

Fixes issue 7095, Add onCreateDefault to AD_TABLE.classname column

---
U trunk/src-db/database/model/tables/AD_TABLE.xml
---

https://dev.openbravo.com/websvn/openbravo/?rev=12228&sc=1 [^]