-- Temporal data to dev
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
	VALUES ('Edi','syncData','WRITE','ALLOW','ROLE','employee');
INSERT INTO edi.tableMultiConfig (fileName, toTable, file, updated) VALUES('CC', 'supplier', 'FEC010104', '2025-02-15');
INSERT INTO edi.tableMultiConfig (fileName, toTable, file, updated) VALUES('CK', 'bucket', 'VBN020101', '2025-02-14');
INSERT INTO edi.tableMultiConfig (fileName, toTable, file, updated) VALUES('FB', 'bucket_type', 'VBN020101', '2025-02-14');
INSERT INTO edi.tableMultiConfig (fileName, toTable, file, updated) VALUES('FE', 'type', 'florecompc2', '2025-02-15');
INSERT INTO edi.tableMultiConfig (fileName, toTable, file, updated) VALUES('FF', 'feature', 'florecompc2', '2025-02-15');
INSERT INTO edi.tableMultiConfig (fileName, toTable, file, updated) VALUES('FG', 'genus', 'florecompc2', '2025-02-15');
INSERT INTO edi.tableMultiConfig (fileName, toTable, file, updated) VALUES('FO', 'item_group', 'florecompc2', '2025-02-15');
INSERT INTO edi.tableMultiConfig (fileName, toTable, file, updated) VALUES('FP', 'item', 'florecompc2', '2025-02-15');
INSERT INTO edi.tableMultiConfig (fileName, toTable, file, updated) VALUES('FS', 'specie', 'florecompc2', '2025-02-15');
INSERT INTO edi.tableMultiConfig (fileName, toTable, file, updated) VALUES('FT', 'plant', 'florecompc2', '2025-02-15');
INSERT INTO edi.tableMultiConfig (fileName, toTable, file, updated) VALUES('FV', 'value', 'florecompc2', '2025-02-15');
INSERT INTO edi.tableMultiConfig (fileName, toTable, file, updated) VALUES('FY', 'item_feature', 'florecompc2', '2025-02-15');
-- ---------

ALTER TABLE edi.tableMultiConfig
	ADD `method` varchar(100) DEFAULT NULL NULL AFTER file,
	DROP PRIMARY KEY,
	DROP KEY to_table,
	ADD id int(10) unsigned NULL FIRST;

UPDATE edi.tableMultiConfig
	SET id = 1, method = 'VBN/Packaging'
	WHERE id IS NULL
		AND fileName='CK';

UPDATE edi.tableMultiConfig
	SET id = 2, method = 'VBN/PackagingType'
	WHERE id IS NULL
		AND fileName='FB';

UPDATE edi.tableMultiConfig
	SET id = 3, method = 'VBN/RegulatoryFeatureType'
	WHERE id IS NULL
		AND fileName='FF';

UPDATE edi.tableMultiConfig
	SET id = 4, method = 'VBN/Genus'
	WHERE id IS NULL
		AND fileName='FG';

UPDATE edi.tableMultiConfig
	SET id = 5, method = 'VBN/Product'
	WHERE id IS NULL
		AND fileName='FP';

UPDATE edi.tableMultiConfig
	SET id = 6, method = 'VBN/ProductFeature'
	WHERE id IS NULL
		AND fileName='FY';

UPDATE edi.tableMultiConfig
	SET id = 7, method = 'VBN/ProductGroup'
	WHERE id IS NULL
		AND fileName='FO';

UPDATE edi.tableMultiConfig
	SET id = 8, method = 'VBN/Plant'
	WHERE id IS NULL
		AND fileName='FT';

UPDATE edi.tableMultiConfig
	SET id = 9, method = 'VBN/Species'
	WHERE id IS NULL
		AND fileName='FS';

UPDATE edi.tableMultiConfig
	SET id = 10, method = 'FEC/Company'
	WHERE id IS NULL
		AND fileName='CC';

UPDATE edi.tableMultiConfig
	SET id = 11, method = 'FEC/FeatureType'
	WHERE id IS NULL
		AND fileName='FE';

UPDATE edi.tableMultiConfig
	SET id = 12, method = 'VBN/FeatureValue'
	WHERE id IS NULL
		AND fileName='FV';

ALTER TABLE edi.tableMultiConfig
	ADD CONSTRAINT tableMultiConfig_pk PRIMARY KEY (id),
	MODIFY COLUMN id int(10) unsigned auto_increment NOT NULL,
	ADD CONSTRAINT tableMultiConfig_unique UNIQUE KEY (toTable);
