salix/db/versions/10835-brownCarnation/32-definitivo.sql

13 lines
716 B
MySQL
Raw Normal View History

ALTER TABLE IF EXISTS `vn2008`.`definitivo` RENAME `vn`.`dmsStorageBox`;
ALTER TABLE IF EXISTS `vn`.`dmsStorageBox`
CHANGE COLUMN IF EXISTS `definitivo_id` `id` int(11) NOT NULL,
CHANGE COLUMN IF EXISTS `empresa_id` `companyFk` int(10) unsigned NOT NULL,
CHANGE COLUMN IF EXISTS `desde` `started` bigint(20) NOT NULL,
CHANGE COLUMN IF EXISTS `hasta` `ended` bigint(20) NOT NULL,
CHANGE COLUMN IF EXISTS `fecha` `created` timestamp NOT NULL DEFAULT current_timestamp();
ALTER TABLE IF EXISTS `vn`.`dmsStorageBox` COMMENT='Caja en la que se guardan la documentacion fisica de dms';
ALTER TABLE IF EXISTS vn.dmsStorageBox ADD CONSTRAINT dmsStorageBox_company_FK
FOREIGN KEY (companyFk) REFERENCES vn.company(id);s