-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb_schema.sql
More file actions
73 lines (63 loc) · 2.44 KB
/
Copy pathdb_schema.sql
File metadata and controls
73 lines (63 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Applications table
--
DROP TABLE IF EXISTS `applications`;
CREATE TABLE IF NOT EXISTS `applications` (
`idApplication` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`prefix` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`isDefault` tinyint(1) DEFAULT '0' NOT NULL,
`isEnabled` tinyint(1) NOT NULL,
`dateCreated` datetime NOT NULL,
`dateUpdated` datetime DEFAULT NULL,
PRIMARY KEY (`idApplication`),
UNIQUE KEY `name` (`name`),
UNIQUE KEY `prefix` (`prefix`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=0;
-- --------------------------------------------------------
--
-- Languages table
--
DROP TABLE IF EXISTS `languages`;
CREATE TABLE IF NOT EXISTS `languages` (
`idLanguage` char(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`isMain` tinyint(1) NOT NULL,
`isEnabled` tinyint(1) NOT NULL,
`dateCreated` datetime NOT NULL,
`dateUpdated` datetime DEFAULT NULL,
PRIMARY KEY (`idLanguage`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Routes table
--
DROP TABLE IF EXISTS `routes`;
CREATE TABLE IF NOT EXISTS `routes` (
`idRoute` int(11) NOT NULL AUTO_INCREMENT,
`idApplication` int(11) DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`pattern` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`module` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`controller` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`action` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`requirements` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`methods` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`isLocalized` tinyint(1) DEFAULT '1' NOT NULL,
`isDefault` tinyint(1) DEFAULT '0' NOT NULL,
`isEnabled` tinyint(1) NOT NULL,
`dateCreated` datetime NOT NULL,
`dateUpdated` datetime DEFAULT NULL,
PRIMARY KEY (`idRoute`),
UNIQUE KEY `route` (`name`),
KEY `IDX_32D5C2B33E030ACD` (`idApplication`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=0;
-- --------------------------------------------------------
--
-- Routes constraint
--
ALTER TABLE `routes`
ADD CONSTRAINT `FK_32D5C2B33E030ACD` FOREIGN KEY (`idApplication`) REFERENCES `applications` (`idApplication`);