forked from scandio/lmvc-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatabasePrincipal.sql
More file actions
99 lines (73 loc) · 2.26 KB
/
DatabasePrincipal.sql
File metadata and controls
99 lines (73 loc) · 2.26 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**
Dump from database aligned to config.json in lmvc-base's root.
Import this into your database to be able to use the DatabasePrincipal.
*/
DROP TABLE IF EXISTS `Groups`;
CREATE TABLE `Groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `Groups` WRITE;
INSERT INTO `Groups` (`id`, `group_name`)
VALUES
(1,'Admin'),
(2,'User');
UNLOCK TABLES;
DROP TABLE IF EXISTS `Roles`;
CREATE TABLE `Roles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`role_name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `Roles` WRITE;
/*!40000 ALTER TABLE `Roles` DISABLE KEYS */;
INSERT INTO `Roles` (`id`, `role_name`)
VALUES
(1,'Read'),
(2,'Edit'),
(3,'Delete');
UNLOCK TABLES;
DROP TABLE IF EXISTS `User_to_Groups`;
CREATE TABLE `User_to_Groups` (
`user_id` int(11) NOT NULL,
`group_id` int(11) NOT NULL,
PRIMARY KEY (`user_id`,`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `User_to_Groups` WRITE;
INSERT INTO `User_to_Groups` (`user_id`, `group_id`)
VALUES
(1,2),
(2,1);
UNLOCK TABLES;
DROP TABLE IF EXISTS `User_to_Roles`;
CREATE TABLE `User_to_Roles` (
`user_id` int(11) NOT NULL,
`role_id` int(11) NOT NULL,
PRIMARY KEY (`user_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `User_to_Roles` WRITE;
INSERT INTO `User_to_Roles` (`user_id`, `role_id`)
VALUES
(1,2),
(2,1),
(2,2),
(2,3);
UNLOCK TABLES;
DROP TABLE IF EXISTS `Users`;
CREATE TABLE `Users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT 'NOT NULL',
`fullname` varchar(255) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`phone` varchar(100) DEFAULT NULL,
`mobile` varchar(100) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `Users` WRITE;
INSERT INTO `Users` (`id`, `username`, `fullname`, `email`, `phone`, `mobile`, `password`)
VALUES
(1,'ckoch','Christian Koch','christian.koch@scandio.de','+49 89 244 124-44','+49 172 852 22 25','e790da6e1157cb9a11063ac32431b8a820662059'),
(2,'admin','Administrator','info@scandio.de','+49 89 244 124-0',NULL,'d033e22ae348aeb5660fc2140aec35850c4da997');
UNLOCK TABLES;