Fix migration - Move to v13

This commit is contained in:
Alexandre SPANGARO 2020-07-06 03:28:53 +02:00
parent 59ee22537d
commit 0525dd3c1f
2 changed files with 39 additions and 43 deletions

View File

@ -27,49 +27,6 @@
-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
-- Note: fields with type BLOB/TEXT can't have default value.
-- Missing in 10.0
-- For 11.0
-- Intracomm Report
CREATE TABLE llx_c_transport_mode (
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
code varchar(3) NOT NULL,
label varchar(255) NOT NULL,
active tinyint DEFAULT 1 NOT NULL
) ENGINE=innodb;
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('MAR', 'Transport maritime (y compris camions ou wagons sur bateau)', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('TRA', 'Transport par chemin de fer (y compris camions sur wagon)', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('ROU', 'Transport par route', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('AIR', 'Transport par air', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('POS', 'Envois postaux', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('OLE', 'Installations de transport fixe (oléoduc)', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('NAV', 'Transport par navigation intérieure', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('PRO', 'Propulsion propre', 1);
ALTER TABLE llx_facture ADD COLUMN fk_transport_mode integer after location_incoterms;
ALTER TABLE llx_facture_fourn ADD COLUMN fk_transport_mode integer after location_incoterms;
ALTER TABLE llx_societe ADD COLUMN transport_mode tinyint after cond_reglement;
ALTER TABLE llx_societe ADD COLUMN transport_mode_supplier tinyint after cond_reglement_supplier;
CREATE TABLE llx_intracommreport
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NOT NULL, -- report reference number
entity integer DEFAULT 1 NOT NULL, -- multi company id
type_declaration varchar(32),
period varchar(32),
mode varchar(32),
content_xml text,
type_export varchar(10),
datec datetime,
tms timestamp
)ENGINE=innodb;
-- Missing in v10
ALTER TABLE llx_account_bookkeeping ADD COLUMN date_export datetime DEFAULT NULL;

View File

@ -74,3 +74,42 @@ ALTER TABLE llx_user DROP COLUMN whatsapp;
ALTER TABLE llx_user ADD COLUMN datestartvalidity datetime;
ALTER TABLE llx_user ADD COLUMN dateendvalidity datetime;
-- Intracomm Report
CREATE TABLE llx_c_transport_mode (
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
code varchar(3) NOT NULL,
label varchar(255) NOT NULL,
active tinyint DEFAULT 1 NOT NULL
) ENGINE=innodb;
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('MAR', 'Transport maritime (y compris camions ou wagons sur bateau)', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('TRA', 'Transport par chemin de fer (y compris camions sur wagon)', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('ROU', 'Transport par route', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('AIR', 'Transport par air', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('POS', 'Envois postaux', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('OLE', 'Installations de transport fixe (oléoduc)', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('NAV', 'Transport par navigation intérieure', 1);
INSERT INTO llx_c_transport_mode (code, label, active) VALUES ('PRO', 'Propulsion propre', 1);
ALTER TABLE llx_facture ADD COLUMN fk_transport_mode integer after location_incoterms;
ALTER TABLE llx_facture_fourn ADD COLUMN fk_transport_mode integer after location_incoterms;
ALTER TABLE llx_societe ADD COLUMN transport_mode tinyint after cond_reglement;
ALTER TABLE llx_societe ADD COLUMN transport_mode_supplier tinyint after cond_reglement_supplier;
CREATE TABLE llx_intracommreport
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NOT NULL, -- report reference number
entity integer DEFAULT 1 NOT NULL, -- multi company id
type_declaration varchar(32),
period varchar(32),
mode varchar(32),
content_xml text,
type_export varchar(10),
datec datetime,
tms timestamp
)ENGINE=innodb;