add categories tickets migration

This commit is contained in:
Frédéric FRANCE 2021-07-21 08:40:07 +02:00
parent c0d54fe608
commit f2dc3be051
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
2 changed files with 36 additions and 21 deletions

View File

@ -411,26 +411,28 @@ if (!file_exists($conffile)) {
if (GETPOST('allowupgrade')) {
$allowupgrade = true;
}
$migrationscript = array(array('from'=>'3.0.0', 'to'=>'3.1.0'),
array('from'=>'3.1.0', 'to'=>'3.2.0'),
array('from'=>'3.2.0', 'to'=>'3.3.0'),
array('from'=>'3.3.0', 'to'=>'3.4.0'),
array('from'=>'3.4.0', 'to'=>'3.5.0'),
array('from'=>'3.5.0', 'to'=>'3.6.0'),
array('from'=>'3.6.0', 'to'=>'3.7.0'),
array('from'=>'3.7.0', 'to'=>'3.8.0'),
array('from'=>'3.8.0', 'to'=>'3.9.0'),
array('from'=>'3.9.0', 'to'=>'4.0.0'),
array('from'=>'4.0.0', 'to'=>'5.0.0'),
array('from'=>'5.0.0', 'to'=>'6.0.0'),
array('from'=>'6.0.0', 'to'=>'7.0.0'),
array('from'=>'7.0.0', 'to'=>'8.0.0'),
array('from'=>'8.0.0', 'to'=>'9.0.0'),
array('from'=>'9.0.0', 'to'=>'10.0.0'),
array('from'=>'10.0.0', 'to'=>'11.0.0'),
array('from'=>'11.0.0', 'to'=>'12.0.0'),
array('from'=>'12.0.0', 'to'=>'13.0.0'),
array('from'=>'13.0.0', 'to'=>'14.0.0')
$migrationscript = array(
array('from'=>'3.0.0', 'to'=>'3.1.0'),
array('from'=>'3.1.0', 'to'=>'3.2.0'),
array('from'=>'3.2.0', 'to'=>'3.3.0'),
array('from'=>'3.3.0', 'to'=>'3.4.0'),
array('from'=>'3.4.0', 'to'=>'3.5.0'),
array('from'=>'3.5.0', 'to'=>'3.6.0'),
array('from'=>'3.6.0', 'to'=>'3.7.0'),
array('from'=>'3.7.0', 'to'=>'3.8.0'),
array('from'=>'3.8.0', 'to'=>'3.9.0'),
array('from'=>'3.9.0', 'to'=>'4.0.0'),
array('from'=>'4.0.0', 'to'=>'5.0.0'),
array('from'=>'5.0.0', 'to'=>'6.0.0'),
array('from'=>'6.0.0', 'to'=>'7.0.0'),
array('from'=>'7.0.0', 'to'=>'8.0.0'),
array('from'=>'8.0.0', 'to'=>'9.0.0'),
array('from'=>'9.0.0', 'to'=>'10.0.0'),
array('from'=>'10.0.0', 'to'=>'11.0.0'),
array('from'=>'11.0.0', 'to'=>'12.0.0'),
array('from'=>'12.0.0', 'to'=>'13.0.0'),
array('from'=>'13.0.0', 'to'=>'14.0.0'),
array('from'=>'14.0.0', 'to'=>'15.0.0'),
);
$count = 0;

View File

@ -26,7 +26,7 @@
-- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL;
-- 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.
-- To rebuild sequence for postgresql after insert by forcing id autoincrement fields:
-- To rebuild sequence for postgresql after insert by forcing id autoincrement fields:
-- -- VPGSQL8.2 SELECT dol_util_rebuild_sequences();
@ -37,3 +37,16 @@
-- v15
CREATE TABLE llx_categorie_ticket
(
fk_categorie integer NOT NULL,
fk_ticket integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
ALTER TABLE llx_categorie_ticket ADD PRIMARY KEY pk_categorie_ticket (fk_categorie, fk_ticket);
ALTER TABLE llx_categorie_ticket ADD INDEX idx_categorie_ticket_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_ticket ADD INDEX idx_categorie_ticket_fk_ticket (fk_ticket);
ALTER TABLE llx_categorie_ticket ADD CONSTRAINT fk_categorie_ticket_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_ticket ADD CONSTRAINT fk_categorie_ticket_ticket_rowid FOREIGN KEY (fk_ticket) REFERENCES llx_ticket (rowid);