salix/db/versions/.archive/10645-purplePalmetto/01-updateCollectionWagonPri...

4 lines
409 B
SQL

ALTER TABLE vn.collectionWagonTicket DROP FOREIGN KEY collectionWagonTicket_ticket;
ALTER TABLE vn.collectionWagonTicket DROP PRIMARY KEY;
ALTER TABLE vn.collectionWagonTicket ADD CONSTRAINT collectionWagonTicket_PK PRIMARY KEY (ticketFk,trayFk);
ALTER TABLE vn.collectionWagonTicket ADD CONSTRAINT collectionWagonTicket_FK FOREIGN KEY (ticketFk) REFERENCES vn.ticket(id) ON DELETE RESTRICT ON UPDATE CASCADE;