salix/db/versions/.archive/10345-wheatRaphis/00-firstScript.sql

16 lines
669 B
MySQL
Raw Permalink Normal View History

use vn;
CREATE OR REPLACE TABLE `paperSize` (
`code` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL,
`color` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL,
`alias` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL,
PRIMARY KEY (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
ALTER TABLE vn.report ADD paperSizeFk varchar(100) DEFAULT NULL NULL;
ALTER TABLE vn.report ADD CONSTRAINT report_FK FOREIGN KEY (paperSizeFk) REFERENCES vn.paperSize(code);
ALTER TABLE vn.printer ADD paperSizeFk varchar(100) DEFAULT NULL NULL;
ALTER TABLE vn.printer ADD CONSTRAINT printer_FK_1 FOREIGN KEY (paperSizeFk) REFERENCES vn.paperSize(code);