salix/db/versions/11157-limeDendro/00-firstScript.sql

11 lines
623 B
MySQL
Raw Permalink Normal View History

2024-07-16 09:38:44 +00:00
2024-07-16 11:06:04 +00:00
ALTER TABLE IF EXISTS vn.sectorCollectionSaleGroup DROP FOREIGN KEY sectorCollectionSaleGroup_ibfk_3;
ALTER TABLE IF EXISTS vn.sectorCollectionSaleGroup DROP FOREIGN KEY sectorCollectionSaleGroup_ibfk_2;
ALTER TABLE IF EXISTS vn.sectorCollectionSaleGroup DROP KEY saleGroupFk;
2024-07-16 09:38:44 +00:00
2024-07-16 11:06:04 +00:00
ALTER TABLE IF EXISTS vn.sectorCollectionSaleGroup ADD CONSTRAINT sectorCollectionSaleGroup_saleGroup_FK
2024-07-16 09:38:44 +00:00
FOREIGN KEY (saleGroupFk) REFERENCES vn.saleGroup(id) ON DELETE CASCADE ON UPDATE CASCADE;
2024-07-16 11:06:04 +00:00
ALTER TABLE IF EXISTS vn.sectorCollectionSaleGroup ADD CONSTRAINT sectorCollectionSaleGroup_unique UNIQUE KEY (sectorCollectionFk,saleGroupFk);