FIX : move all sql stock transfer queries into 15 => 16 migration file

This commit is contained in:
Gauthier PC portable 024 2022-03-10 11:37:52 +01:00
parent db7bd84ec3
commit 732724ea51
2 changed files with 82 additions and 83 deletions

View File

@ -392,89 +392,6 @@ ALTER TABLE llx_societe_perentity ADD COLUMN accountancy_code_supplier varchar(2
ALTER TABLE llx_projet_task ADD COLUMN budget_amount double(24,8) AFTER priority;
-- Stock transfers module
CREATE TABLE llx_stocktransfer_stocktransfer(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
entity integer DEFAULT 1 NOT NULL,
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
label varchar(255),
fk_soc integer,
fk_project integer,
fk_warehouse_source integer,
fk_warehouse_destination integer,
description text,
note_public text,
note_private text,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
date_creation datetime NOT NULL,
date_prevue_depart date DEFAULT NULL,
date_reelle_depart date DEFAULT NULL,
date_prevue_arrivee date DEFAULT NULL,
date_reelle_arrivee date DEFAULT NULL,
lead_time_for_warning integer DEFAULT NULL,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
model_pdf varchar(255),
last_main_doc varchar(255),
status smallint NOT NULL,
fk_incoterms integer, -- for incoterms
location_incoterms varchar(255)
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_rowid (rowid);
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_ref (ref);
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_fk_soc (fk_soc);
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_fk_project (fk_project);
ALTER TABLE llx_stocktransfer_stocktransfer ADD CONSTRAINT llx_stocktransfer_stocktransfer_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_status (status);
CREATE TABLE llx_stocktransfer_stocktransferline(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
amount double DEFAULT NULL,
qty real,
fk_warehouse_source integer NOT NULL,
fk_warehouse_destination integer NOT NULL,
fk_stocktransfer integer NOT NULL,
fk_product integer NOT NULL,
batch varchar(128) DEFAULT NULL, -- Lot or serial number
pmp double,
rang integer DEFAULT 0,
fk_parent_line integer NULL
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
ALTER TABLE llx_stocktransfer_stocktransferline ADD INDEX idx_stocktransfer_stocktransferline_rowid (rowid);
create table llx_stocktransfer_stocktransfer_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
ALTER TABLE llx_stocktransfer_stocktransfer_extrafields ADD INDEX idx_fk_object(fk_object);
create table llx_stocktransfer_stocktransferline_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
ALTER TABLE llx_stocktransfer_stocktransferline_extrafields ADD INDEX idx_fk_object(fk_object);
ALTER TABLE llx_stock_mouvement CHANGE origintype origintype VARCHAR(64)
-- End Stock transfers module
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_ticket_by_severity.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_ticket_by_severity.php' AND entity = 1);
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_nb_ticket_last_x_days.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_nb_ticket_last_x_days.php' AND entity = 1);
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_nb_tickets_type.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_nb_tickets_type.php' AND entity = 1);

View File

@ -280,3 +280,85 @@ ALTER TABLE llx_propal ADD last_main_doc VARCHAR(255) NULL AFTER model_pdf;
UPDATE llx_c_country SET eec=0 WHERE eec IS NULL;
ALTER TABLE llx_c_country MODIFY COLUMN eec tinyint DEFAULT 0 NOT NULL;
-- Stock transfers module
CREATE TABLE llx_stocktransfer_stocktransfer(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
entity integer DEFAULT 1 NOT NULL,
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
label varchar(255),
fk_soc integer,
fk_project integer,
fk_warehouse_source integer,
fk_warehouse_destination integer,
description text,
note_public text,
note_private text,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
date_creation datetime NOT NULL,
date_prevue_depart date DEFAULT NULL,
date_reelle_depart date DEFAULT NULL,
date_prevue_arrivee date DEFAULT NULL,
date_reelle_arrivee date DEFAULT NULL,
lead_time_for_warning integer DEFAULT NULL,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
model_pdf varchar(255),
last_main_doc varchar(255),
status smallint NOT NULL,
fk_incoterms integer, -- for incoterms
location_incoterms varchar(255)
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_rowid (rowid);
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_ref (ref);
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_fk_soc (fk_soc);
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_fk_project (fk_project);
ALTER TABLE llx_stocktransfer_stocktransfer ADD CONSTRAINT llx_stocktransfer_stocktransfer_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
ALTER TABLE llx_stocktransfer_stocktransfer ADD INDEX idx_stocktransfer_stocktransfer_status (status);
CREATE TABLE llx_stocktransfer_stocktransferline(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
amount double DEFAULT NULL,
qty real,
fk_warehouse_source integer NOT NULL,
fk_warehouse_destination integer NOT NULL,
fk_stocktransfer integer NOT NULL,
fk_product integer NOT NULL,
batch varchar(128) DEFAULT NULL, -- Lot or serial number
pmp double,
rang integer DEFAULT 0,
fk_parent_line integer NULL
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
ALTER TABLE llx_stocktransfer_stocktransferline ADD INDEX idx_stocktransfer_stocktransferline_rowid (rowid);
create table llx_stocktransfer_stocktransfer_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
ALTER TABLE llx_stocktransfer_stocktransfer_extrafields ADD INDEX idx_fk_object(fk_object);
create table llx_stocktransfer_stocktransferline_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
ALTER TABLE llx_stocktransfer_stocktransferline_extrafields ADD INDEX idx_fk_object(fk_object);
ALTER TABLE llx_stock_mouvement CHANGE origintype origintype VARCHAR(64)
-- End Stock transfers module