salix/db/versions/10896-salmonOrchid/14-movement_label.sql

13 lines
502 B
SQL

DROP TRIGGER IF EXISTS `vn2008`.`movement_label_afterUpdate`;
ALTER TABLE vn2008.movement_label DROP FOREIGN KEY movement_label_ibfk_1;
DROP VIEW IF EXISTS `vn`.`saleLabel`;
ALTER TABLE IF EXISTS `vn2008`.`movement_label` RENAME `vn`.`saleLabel`;
ALTER TABLE IF EXISTS `vn`.`saleLabel`
CHANGE COLUMN IF EXISTS `Id_movimiento` `saleFk` int(11) NOT NULL;
ALTER TABLE `vn`.`saleLabel` ADD CONSTRAINT saleLabel_sale_FK FOREIGN KEY (saleFk) REFERENCES vn.sale(id) ON DELETE CASCADE ON UPDATE CASCADE;