diff --git a/db/versions/11157-limeDendro/00-firstScript.sql b/db/versions/11157-limeDendro/00-firstScript.sql new file mode 100644 index 000000000..21071ee3f --- /dev/null +++ b/db/versions/11157-limeDendro/00-firstScript.sql @@ -0,0 +1,11 @@ + +ALTER TABLE vn.sectorCollectionSaleGroup DROP FOREIGN KEY sectorCollectionSaleGroup_ibfk_3; +ALTER TABLE vn.sectorCollectionSaleGroup DROP FOREIGN KEY sectorCollectionSaleGroup_ibfk_2; +ALTER TABLE vn.sectorCollectionSaleGroup DROP KEY saleGroupFk; + + +ALTER TABLE vn.sectorCollectionSaleGroup ADD CONSTRAINT sectorCollectionSaleGroup_saleGroup_FK + FOREIGN KEY (saleGroupFk) REFERENCES vn.saleGroup(id) ON DELETE CASCADE ON UPDATE CASCADE; + + +ALTER TABLE vn.sectorCollectionSaleGroup ADD CONSTRAINT sectorCollectionSaleGroup_unique UNIQUE KEY (sectorCollectionFk,saleGroupFk); \ No newline at end of file