salix/db/versions/.archive/10428-wheatRose/00-firstScript.sql

15 lines
742 B
MySQL
Raw Permalink Normal View History

USE vn;
CREATE TABLE `mdbVersionTree` (
`app` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
`version` int(10) unsigned NOT NULL,
`branchFk` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
`fromVersion` int(10) unsigned NOT NULL,
`userFk` int(10) unsigned NOT NULL,
`created` timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`app`,`version`),
KEY `mdbVersionTree_FK` (`userFk`),
KEY `mdbVersionTree_FK_2` (`branchFk`),
CONSTRAINT `mdbVersionTree_FK` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE,
CONSTRAINT `mdbVersionTree_FK_2` FOREIGN KEY (`branchFk`) REFERENCES `mdbBranch` (`name`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;