This repository has been archived by the owner on Dec 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schedule_teachers_abastos.sql
140 lines (104 loc) · 5.39 KB
/
schedule_teachers_abastos.sql
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
CREATE TABLE `classrooms` (
`name` varchar(50) COLLATE utf8mb4_spanish_ci NOT NULL,
`description` varchar(50) COLLATE utf8mb4_spanish_ci DEFAULT NULL,
`state` varchar(50) COLLATE utf8mb4_spanish_ci DEFAULT NULL,
`enabled` tinyint(1) DEFAULT '1',
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;
INSERT INTO classrooms VALUES
("201","desc","perfect","1"),
("204","desc","perfect","1"),
("205","desc","perfect","1"),
("206","desc","perfect","1"),
("207","desc","perfect","1"),
("208","desc","perfect","1"),
("209","desc","perfect","1"),
("el","test funciona","perfect","1"),
("renejne","jyjrt","perfect","1"),
("se","añade","perfect","1"),
("test","purrfect","perfect","1"),
("wegwehwe","wehwehwe","perfect","1"),
("wfgweg","wegwegwe","perfect","1");
CREATE TABLE `events` (
`username` varchar(24) COLLATE utf8mb4_spanish_ci NOT NULL,
`orderId` tinyint(4) NOT NULL,
`year` date NOT NULL,
`title` varchar(50) COLLATE utf8mb4_spanish_ci DEFAULT NULL,
`selectedDay` date NOT NULL,
`classRoomName` varchar(50) COLLATE utf8mb4_spanish_ci NOT NULL,
PRIMARY KEY (`orderId`,`year`,`selectedDay`,`classRoomName`),
KEY `username` (`username`),
KEY `classRoomName` (`classRoomName`),
CONSTRAINT `events_ibfk_1` FOREIGN KEY (`orderId`, `year`) REFERENCES `schedules` (`orderId`, `year`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `events_ibfk_2` FOREIGN KEY (`username`) REFERENCES `users` (`username`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `events_ibfk_3` FOREIGN KEY (`classRoomName`) REFERENCES `classrooms` (`name`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;
INSERT INTO events VALUES
("teste","1","2019-02-02","test","2020-02-13","205"),
("teste","1","2019-02-02","Test","2020-02-16","205"),
("jofaval","1","2019-02-02","wegwe","2020-02-21","205"),
("jofaval","2","2019-02-02","wegewgwegw","2020-02-04","205"),
("teste","2","2019-02-02","Test","2020-02-10","205"),
("teste","2","2019-02-02","Test","2020-02-10","207"),
("teste","2","2019-02-02","Test","2020-02-12","205"),
("jofaval","3","2019-02-02","prueba","2020-02-12","205"),
("jofaval","3","2019-02-02","Escogido","2020-02-14","205"),
("jofaval","4","2019-02-02","clase de pi ano","2020-02-24","205"),
("jofaval","7","2019-02-02","wehwehwe","2020-02-12","205");
CREATE TABLE `nonworkweeklydays` (
`nonWorkDay` int(11) NOT NULL,
`year` date NOT NULL,
PRIMARY KEY (`nonWorkDay`,`year`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;
CREATE TABLE `schedules` (
`orderId` tinyint(4) NOT NULL,
`startHour` varchar(5) COLLATE utf8mb4_spanish_ci DEFAULT NULL,
`endHour` varchar(5) COLLATE utf8mb4_spanish_ci DEFAULT NULL,
`year` date NOT NULL,
PRIMARY KEY (`orderId`,`year`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;
INSERT INTO schedules VALUES
("1","7:55","8:50","2019-02-02"),
("2","8:50","9:45","2019-02-02"),
("3","9:45","10:40","2019-02-02"),
("4","11:00","11:55","2019-02-02"),
("5","11:55","12:50","2019-02-02"),
("6","12:50","13:45","2019-02-02"),
("7","14:05","15:00","2019-02-02"),
("8","15:00","15:55","2019-02-02"),
("9","15:55","16:50","2019-02-02"),
("10","16:50","17:45","2019-02-02"),
("11","18:05","19:00","2019-02-02"),
("12","19:00","19:55","2019-02-02"),
("13","19:55","20:50","2019-02-02"),
("14","20:50","21:10","2019-02-02"),
("15","21:10","22:05","2019-02-02");
CREATE TABLE `specialdays` (
`specialDay` date NOT NULL,
`type` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`specialDay`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;
INSERT INTO specialdays VALUES
("2020-02-23","0"),
("2020-10-09","1"),
("2020-12-29","2");
CREATE TABLE `users` (
`username` varchar(24) COLLATE utf8mb4_spanish_ci NOT NULL,
`fullname` varchar(50) COLLATE utf8mb4_spanish_ci DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_spanish_ci NOT NULL,
`image` varchar(255) COLLATE utf8mb4_spanish_ci NOT NULL,
`type` tinyint(4) NOT NULL,
`email` varchar(100) COLLATE utf8mb4_spanish_ci NOT NULL,
`enabled` tinyint(1) DEFAULT '1',
PRIMARY KEY (`username`),
UNIQUE KEY `ui_users_email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish_ci;
INSERT INTO users VALUES
("jofaval","Pepe Fabra","$2a$09$esternocleidomastoideetywGL9Sf5TXyFHwilEcX5OTB5tlZG6e","./img_usuarios/bg2.jpg","3","jofaval","1"),
("jofaval2","Pepe Fabra","$2a$09$esternocleidomastoideetywGL9Sf5TXyFHwilEcX5OTB5tlZG6e","./img_usuarios/1581777008_blurred-tulips - copia.jpeg","1","jofaval2","1"),
("newUser","Pepe Fabra","$2a$09$esternocleidomastoideetywGL9Sf5TXyFHwilEcX5OTB5tlZG6e","./img_usuarios/1581778987_blurred-tulips - copia.jpeg","1","newTest","1"),
("prueba","Pepe Fabra","$2a$09$esternocleidomastoideetywGL9Sf5TXyFHwilEcX5OTB5tlZG6e","./img_usuarios/prueba.g","1","prueba@iesabastos.org","1"),
("teste","Pepe Fabra","$2a$09$esternocleidomastoideetywGL9Sf5TXyFHwilEcX5OTB5tlZG6e","test.jph","3","teste@iesabastos.org","1"),
("wegwe","Pepe Fabra","$2a$09$esternocleidomastoideetywGL9Sf5TXyFHwilEcX5OTB5tlZG6e","./img_usuarios/wegwe.l","1","wegwhweh@iesabastos.org","1"),
("wegwehwehwe","Pepe Fabra","$2a$09$esternocleidomastoideetywGL9Sf5TXyFHwilEcX5OTB5tlZG6e","./img_usuarios/wegwehwehwe.l","1","wegwjhwehy@iesabastos.org","1"),
("wehwehwehwe","ewghweghwehwehweh","$2a$09$esternocleidomastoideeTA.ozyFa9xjzxkCo6VpXsNb2J2HdHt.","./img_usuarios/blurred-tulips.jpg","1","wehwehwehwh","1");