My app was in a fake migration mode, and when I enabled a migration it
wanted to re-ecreate two existing tables, one regular (pmt), the other
archive (customer_archive)... (sql.log bellow).
I renamed existing tables in order to proceed...
What I see is that archive table got created with is_active notnull, and
default T, while existing tables stayed as is...
Tried updating record in customer table and all worked ok...
sql.log:
timestamp: 2012-12-22T13:57:59.269217
ALTER TABLE lookup ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE lookup SET is_active__tmp=is_active;
faked!
ALTER TABLE lookup DROP COLUMN is_active;
faked!
ALTER TABLE lookup ADD is_active CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE lookup SET is_active=is_active__tmp;
faked!
ALTER TABLE lookup DROP COLUMN is_active__tmp;
faked!
timestamp: 2012-12-22T13:57:59.298807
ALTER TABLE comment ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE comment SET is_active__tmp=is_active;
faked!
ALTER TABLE comment DROP COLUMN is_active;
faked!
ALTER TABLE comment ADD is_active CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE comment SET is_active=is_active__tmp;
faked!
ALTER TABLE comment DROP COLUMN is_active__tmp;
faked!
timestamp: 2012-12-22T13:57:59.342240
ALTER TABLE configuration ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE configuration SET is_active__tmp=is_active;
faked!
ALTER TABLE configuration DROP COLUMN is_active;
faked!
ALTER TABLE configuration ADD is_active CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE configuration SET is_active=is_active__tmp;
faked!
ALTER TABLE configuration DROP COLUMN is_active__tmp;
faked!
timestamp: 2012-12-22T13:57:59.375178
ALTER TABLE supplier ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE supplier SET is_active__tmp=is_active;
faked!
ALTER TABLE supplier DROP COLUMN is_active;
faked!
ALTER TABLE supplier ADD is_active CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE supplier SET is_active=is_active__tmp;
faked!
ALTER TABLE supplier DROP COLUMN is_active__tmp;
faked!
timestamp: 2012-12-22T13:57:59.415936
ALTER TABLE customer ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE customer SET is_active__tmp=is_active;
faked!
ALTER TABLE customer DROP COLUMN is_active;
faked!
ALTER TABLE customer ADD is_active CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE customer SET is_active=is_active__tmp;
faked!
ALTER TABLE customer DROP COLUMN is_active__tmp;
faked!
timestamp: 2012-12-22T13:57:59.464933
ALTER TABLE next_po_number ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE next_po_number SET is_active__tmp=is_active;
faked!
ALTER TABLE next_po_number DROP COLUMN is_active;
faked!
ALTER TABLE next_po_number ADD is_active CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE next_po_number SET is_active=is_active__tmp;
faked!
ALTER TABLE next_po_number DROP COLUMN is_active__tmp;
faked!
timestamp: 2012-12-22T13:57:59.511872
ALTER TABLE purchase_order ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE purchase_order SET is_active__tmp=is_active;
faked!
ALTER TABLE purchase_order DROP COLUMN is_active;
faked!
ALTER TABLE purchase_order ADD is_active CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE purchase_order SET is_active=is_active__tmp;
faked!
ALTER TABLE purchase_order DROP COLUMN is_active__tmp;
faked!
timestamp: 2012-12-22T13:57:59.618962
ALTER TABLE product_family ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE product_family SET is_active__tmp=is_active;
faked!
ALTER TABLE product_family DROP COLUMN is_active;
faked!
ALTER TABLE product_family ADD is_active CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE product_family SET is_active=is_active__tmp;
faked!
ALTER TABLE product_family DROP COLUMN is_active__tmp;
faked!
timestamp: 2012-12-22T13:57:59.650635
ALTER TABLE sku ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE sku SET is_active__tmp=is_active;
faked!
ALTER TABLE sku DROP COLUMN is_active;
faked!
ALTER TABLE sku ADD is_active CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE sku SET is_active=is_active__tmp;
faked!
ALTER TABLE sku DROP COLUMN is_active__tmp;
faked!
timestamp: 2012-12-22T13:57:59.688207
ALTER TABLE item ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE item SET is_active__tmp=is_active;
faked!
ALTER TABLE item DROP COLUMN is_active;
faked!
ALTER TABLE item ADD is_active CHAR(1) NOT NULL DEFAULT 'T';
faked!
UPDATE item SET is_active=is_active__tmp;
faked!
ALTER TABLE item DROP COLUMN is_active__tmp;
faked!
timestamp: 2012-12-22T14:05:28.630734
CREATE TABLE pmt(
id INT AUTO_INCREMENT NOT NULL,
tbl_uuid VARCHAR(64),
po_id INT, INDEX po_id__idx (po_id), FOREIGN KEY (po_id) REFERENCES
purchase_order (id) ON DELETE CASCADE,
currency VARCHAR(255),
invoice_no VARCHAR(255),
amount_paid DOUBLE,
date_wire_actg DATE,
partial_payment VARCHAR(255),
amount_paid2 DOUBLE,
date_to_actg2 DATE,
amount_paid3 DOUBLE,
date_to_actg3 DATE,
amount_paid4 DOUBLE,
date_to_actg4 DATE,
payment_notes1 LONGTEXT,
payment_notes2 LONGTEXT,
payment_notes3 LONGTEXT,
is_active CHAR(1) NOT NULL DEFAULT 'T',
created_on DATETIME,
created_by INT, INDEX created_by__idx (created_by), FOREIGN KEY
(created_by) REFERENCES auth_user (id) ON DELETE CASCADE,
modified_on DATETIME,
modified_by INT, INDEX modified_by__idx (modified_by), FOREIGN KEY
(modified_by) REFERENCES auth_user (id) ON DELETE CASCADE,
PRIMARY KEY(id)
) ENGINE=InnoDB CHARACTER SET utf8;
timestamp: 2012-12-22T14:11:13.034603
CREATE TABLE pmt(
id INT AUTO_INCREMENT NOT NULL,
tbl_uuid VARCHAR(64),
po_id INT, INDEX po_id__idx (po_id), FOREIGN KEY (po_id) REFERENCES
purchase_order (id) ON DELETE CASCADE,
currency VARCHAR(255),
invoice_no VARCHAR(255),
amount_paid DOUBLE,
date_wire_actg DATE,
partial_payment VARCHAR(255),
amount_paid2 DOUBLE,
date_to_actg2 DATE,
amount_paid3 DOUBLE,
date_to_actg3 DATE,
amount_paid4 DOUBLE,
date_to_actg4 DATE,
payment_notes1 LONGTEXT,
payment_notes2 LONGTEXT,
payment_notes3 LONGTEXT,
is_active CHAR(1) NOT NULL DEFAULT 'T',
created_on DATETIME,
created_by INT, INDEX created_by__idx (created_by), FOREIGN KEY
(created_by) REFERENCES auth_user (id) ON DELETE CASCADE,
modified_on DATETIME,
modified_by INT, INDEX modified_by__idx (modified_by), FOREIGN KEY
(modified_by) REFERENCES auth_user (id) ON DELETE CASCADE,
PRIMARY KEY(id)
) ENGINE=InnoDB CHARACTER SET utf8;
success!
timestamp: 2012-12-22T14:16:04.319236
CREATE TABLE customer_archive(
current_record INT, INDEX current_record__idx (current_record), FOREIGN KEY
(current_record) REFERENCES customer (id) ON DELETE CASCADE,
id INT AUTO_INCREMENT NOT NULL,
tbl_uuid VARCHAR(64),
name VARCHAR(255),
number VARCHAR(255),
address LONGTEXT,
ship_to LONGTEXT,
payment_term INT, INDEX payment_term__idx (payment_term), FOREIGN KEY
(payment_term) REFERENCES lookup (id) ON DELETE CASCADE,
forwarder LONGTEXT,
destination VARCHAR(255),
attn VARCHAR(255),
phone VARCHAR(255),
fax VARCHAR(255),
email VARCHAR(255),
bl_telex_released VARCHAR(255),
orig_docs_to LONGTEXT,
doc_requirements LONGTEXT,
special_instructions LONGTEXT,
shipping_marks LONGTEXT,
is_active CHAR(1) NOT NULL DEFAULT 'T',
created_on DATETIME,
created_by INT, INDEX created_by__idx (created_by), FOREIGN KEY
(created_by) REFERENCES auth_user (id) ON DELETE CASCADE,
modified_on DATETIME,
modified_by INT, INDEX modified_by__idx (modified_by), FOREIGN KEY
(modified_by) REFERENCES auth_user (id) ON DELETE CASCADE,
PRIMARY KEY(id)
) ENGINE=InnoDB CHARACTER SET utf8;
timestamp: 2012-12-22T14:18:50.404571
CREATE TABLE customer_archive(
current_record INT, INDEX current_record__idx (current_record), FOREIGN KEY
(current_record) REFERENCES customer (id) ON DELETE CASCADE,
id INT AUTO_INCREMENT NOT NULL,
tbl_uuid VARCHAR(64),
name VARCHAR(255),
number VARCHAR(255),
address LONGTEXT,
ship_to LONGTEXT,
payment_term INT, INDEX payment_term__idx (payment_term), FOREIGN KEY
(payment_term) REFERENCES lookup (id) ON DELETE CASCADE,
forwarder LONGTEXT,
destination VARCHAR(255),
attn VARCHAR(255),
phone VARCHAR(255),
fax VARCHAR(255),
email VARCHAR(255),
bl_telex_released VARCHAR(255),
orig_docs_to LONGTEXT,
doc_requirements LONGTEXT,
special_instructions LONGTEXT,
shipping_marks LONGTEXT,
is_active CHAR(1) NOT NULL DEFAULT 'T',
created_on DATETIME,
created_by INT, INDEX created_by__idx (created_by), FOREIGN KEY
(created_by) REFERENCES auth_user (id) ON DELETE CASCADE,
modified_on DATETIME,
modified_by INT, INDEX modified_by__idx (modified_by), FOREIGN KEY
(modified_by) REFERENCES auth_user (id) ON DELETE CASCADE,
PRIMARY KEY(id)
) ENGINE=InnoDB CHARACTER SET utf8;
success!
On Saturday, December 22, 2012 1:56:28 PM UTC-5, Massimo Di Pierro wrote:
>
> Specifically let me know:
> - after upgrade, do you see a migration in sql.log?
> - does everything seem to work or you get a ticket?
>
> Masimo
>
> On Saturday, 22 December 2012 12:30:25 UTC-6, Adi wrote:
>>
>> do you mean: db._common_fields.append(auth.signature)
>>
>> i have it, and can test now
>>
>> On Saturday, December 22, 2012 12:44:06 PM UTC-5, Massimo Di Pierro wrote:
>>>
>>> If you have fields with auth.signature and mysql/pgsql could you help me
>>> test the latest trunk?
>>>
>>> The reason is that I changed the is_active field from notnull=False to
>>> notnull=True. This should trigger a migration of your data. I want to make
>>> sure nothing breaks.
>>>
>>> Can you confirm this is ok?
>>>
>>> Massimo
>>>
>>
--