Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012603Openbravo ERPZ. Otherspublic2010-03-09 11:212010-03-13 00:00
marvintm 
marvintm 
urgentmajorhave not tried
closedfixed 
5
 
2.50MP142.50MP14 
Core
No
0012603: When update.database tries to add a column to a table, if the column is mandatory and doesn't have a default, data can be lost
When update.database tries to add a mandatory column to an existing table, and the column doesn't have an oncreatedefault or default defined for it, the table will be created correctly, but the original data will be lost.
- Add a mandatory column to the XML file of a table. Do not define a default value, or oncreate default.
- Do update.database
- The new table will have the column, but it will be empty.
DBSM will be changed so that the data is not lost, although the constraint will not be activated in this case (so, still an error, but at least the data is not lost).
No tags attached.
Issue History
2010-03-09 11:21marvintmNew Issue
2010-03-09 11:21marvintmAssigned To => marvintm
2010-03-11 10:02marvintmTarget Version => 2.50MP14
2010-03-11 11:12hgbotCheckin
2010-03-11 11:12hgbotNote Added: 0025237
2010-03-11 11:12hgbotStatusnew => resolved
2010-03-11 11:12hgbotResolutionopen => fixed
2010-03-11 11:12hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b7add0e35b053daa500c9374e5096b7ea2db943f [^]
2010-03-12 16:03alostaleStatusresolved => closed
2010-03-12 16:03alostaleFixed in Version => 2.50MP14
2010-03-12 22:41hudsonbotCheckin
2010-03-12 22:41hudsonbotNote Added: 0025427
2010-03-13 00:00anonymoussf_bug_id0 => 2969677

Notes
(0025237)
hgbot   
2010-03-11 11:12   
Repository: erp/devel/pi
Changeset: b7add0e35b053daa500c9374e5096b7ea2db943f
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Mar 11 11:17:14 2010 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b7add0e35b053daa500c9374e5096b7ea2db943f [^]

Fixed issue 12603. NOT NULL constraints will not be active when copying data from the temporary table to the final one, when a table is recreated. This will ensure that even if the column definition is incorrect (ex. if it's mandatory, but doesn't have a default or onCreateDefault value), the data is not lost.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0025427)
hudsonbot   
2010-03-12 22:41   
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/b7add0e35b05 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/631c626866c1 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.16685.obx [^]