salix/services/db/changes/1.0.0/05-articles_nicho.sql

17 lines
486 B
MySQL
Raw Normal View History

ALTER TABLE `vn2008`.`Articles_nicho`
DROP FOREIGN KEY `Articles_nichos_fk`;
ALTER TABLE `vn2008`.`Articles_nicho`
CHANGE COLUMN `Id_Article` `Id_Article` INT(11) NOT NULL ,
ADD COLUMN `id` INT NOT NULL AUTO_INCREMENT AFTER `modificationDate`,
DROP PRIMARY KEY,
ADD PRIMARY KEY (`id`);
ALTER TABLE `vn2008`.`Articles_nicho`
ADD CONSTRAINT `Articles_nichos_fk`
FOREIGN KEY (`Id_Article`)
REFERENCES `vn2008`.`Articles` (`Id_Article`)
ON DELETE CASCADE
ON UPDATE CASCADE;
2018-02-19 12:21:15 +00:00