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

17 lines
486 B
SQL

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;