diff --git a/db/versions/11308-redCymbidium/00-firstScript.sql b/db/versions/11308-redCymbidium/00-firstScript.sql index baa703a5a..6e0afdd8b 100644 --- a/db/versions/11308-redCymbidium/00-firstScript.sql +++ b/db/versions/11308-redCymbidium/00-firstScript.sql @@ -1,14 +1,16 @@ CREATE TABLE IF NOT EXISTS `vn`.`itemCampaignQuantity` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, dated date NOT NULL, itemFk int(11) NOT NULL, quantity decimal(10,2) NOT NULL, campaign varchar(100) NOT NULL, - CONSTRAINT itemCampaignQuantity_pk PRIMARY KEY (dated,itemFk), + UNIQUE KEY `itemCampaignQuantity_UNIQUE` (`dated`,`itemFk`), CONSTRAINT itemCampaignQuantity_item_FK FOREIGN KEY (itemFk) REFERENCES vn.item(id) ON DELETE RESTRICT ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 -COLLATE=utf8mb3_unicode_ci; +COLLATE=utf8mb3_unicode_ci +COMMENT='Tallos confirmados por día en los días de más producción de una campaña'; CREATE TABLE IF NOT EXISTS `vn`.`itemCampaignQuantityConfig` ( id int(10) unsigned NOT NULL PRIMARY KEY,