Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013921Openbravo ERPY. DBSourceManagerpublic2010-07-08 13:052010-08-12 00:00
networkb 
marvintm 
normalminoralways
closedfixed 
20Community Appliance
2.50MP19 
2.50MP22 
OBPS
Core
No
0013921: The message error is wrong when a column belong to the same module that table and name start with EM
When you create a column with name EM_DBPREFIX_NAMECOLUMN, and the column belong to the same module that table, when you run export.database the message error is:
Errors for Validation type: NOT_EXIST_IN_DB
Column NAMETABLE.EM_DBPREFIX_NAMECOLUMN defined in the Application Dictionary but not present in the database.

This error is wrong, because the column is defined in database.
. create a new table belong to module "M" (prefix database DBPREFIX), with a column "EM_DBPREFIX_COL1".
. create in application dictionary this table and columns. All columns belong to module "M".
. run export.database

. error is returned
No tags attached.
Issue History
2010-07-08 13:05networkbNew Issue
2010-07-08 13:05networkbAssigned To => marvintm
2010-07-08 13:05networkbOBNetwork customer => Yes
2010-07-12 08:54alostaleStatusnew => scheduled
2010-07-29 13:16marvintmNote Added: 0029665
2010-07-29 13:17marvintmNote Edited: 0029665bug_revision_view_page.php?bugnote_id=0029665#r629
2010-07-29 13:19hgbotCheckin
2010-07-29 13:19hgbotNote Added: 0029666
2010-07-29 13:19hgbotStatusscheduled => resolved
2010-07-29 13:19hgbotResolutionopen => fixed
2010-07-29 13:19hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a3213b55a054628c5424e76800c5f617d746d8be [^]
2010-07-30 19:32hudsonbotCheckin
2010-07-30 19:32hudsonbotNote Added: 0029720
2010-07-30 19:36hudsonbotCheckin
2010-07-30 19:36hudsonbotNote Added: 0029726
2010-08-11 11:22iperdomoNote Added: 0029884
2010-08-11 11:23iperdomoNote Added: 0029885
2010-08-11 11:23iperdomoStatusresolved => closed
2010-08-12 00:00anonymoussf_bug_id0 => 3043342

Notes
(0029665)
marvintm   
2010-07-29 13:16   
(edited on: 2010-07-29 13:17)
Important note: it is wrong to name a column EM_dbprefix_mycolumn if the dbprefix is the one from the module which owns the table (as EM means External Module). In that case, mycolumn should just be used as the column name.

However, it is true that the validation message is not clear at all, and doesn't warn you of this fact. Therefore, we are going to improve the message so that this problem is shown more precisely.

(0029666)
hgbot   
2010-07-29 13:19   
Repository: erp/devel/pi
Changeset: a3213b55a054628c5424e76800c5f617d746d8be
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Jul 29 13:17:26 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a3213b55a054628c5424e76800c5f617d746d8be [^]

Fixed issue 13921. Improved validation so that the message is clearer
We haven't changed the naming rule used to infer the owner of a database column. Therefore, a column which starts with EM_dbprefix needs to use a dbprefix of a _different_ module from the one which owns the table (this makes sense, as EM means External Module). However, we have changed the message so that now it warns of this rule in case the column starts with EM_dbprefix and is missing in the physical model.

---
M src/org/openbravo/service/system/DatabaseValidator.java
---
(0029720)
hudsonbot   
2010-07-30 19:32   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/a3213b55a054 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/a2a477578cf4 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17999.obx [^]
(0029726)
hudsonbot   
2010-07-30 19:36   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/a3213b55a054 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/a2a477578cf4 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17999.obx [^]
(0029884)
iperdomo   
2010-08-11 11:22   
The new message is:

[exportdatabase] +++++++++++++++++++++++++++++++++++++++++++++++++++
[exportdatabase] Errors for Validation type: NOT_EXIST_IN_DB
[exportdatabase] +++++++++++++++++++++++++++++++++++++++++++++++++++
[exportdatabase] Column OBISSUE_Test1.EM_Obissue_Name defined in the Application Dictionary but not present in the database. The problem could also be that the column name has a dbprefix of a non existant module or that it starts with the dbprefix of the module which owns the table. In this second case, the column doesn't need the 'EM_DBPREFIX' prefix, you can use the name you want.
(0029885)
iperdomo   
2010-08-11 11:23   
Tested on pi @ rev a45ffdf7b265