-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmysql.sql
87 lines (78 loc) · 2.74 KB
/
mysql.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
CREATE DATABASE gandula IF NOT EXISTS;
CREATE TABLE `usuario` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nome` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`senha` varchar(250) NOT NULL,
`datanascimento` date NOT NULL,
`telefone` varchar(20) DEFAULT '',
`tipo` varchar(40) NOT NULL,
`foto` varchar(200) NOT NULL,
`token` varchar(250) DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4
CREATE TABLE `turma` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idUserCriador` int(11) NOT NULL,
`idUserLider` int(11) DEFAULT '',
`nome` varchar(200) NOT NULL,
`cor` varchar(10) NOT NULL,
`codigo` varchar(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4
CREATE TABLE `turmamembros` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idTurma` int(11) NOT NULL,
`idUserMembro` int(11) NOT NULL,
`cor` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4
CREATE TABLE `postagem` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idUserCriador` int(11) NOT NULL,
`idTurma` int(11) NOT NULL,
`conteudo` text COLLATE utf8mb4_unicode_ci NOT NULL,
`data` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci
CREATE TABLE `horario` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idTurma` int(11) NOT NULL,
`title` varchar(220) DEFAULT NULL,
`color` varchar(10) DEFAULT NULL,
`start` datetime DEFAULT NULL,
`end` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8
CREATE TABLE `enquete` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_turma` int(11) NOT NULL,
`titulo` varchar(250) NOT NULL,
`texto` longtext NOT NULL,
`data_inicial` datetime DEFAULT NULL,
`data_final` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4
CREATE TABLE `enquete_pergunta` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idEnquete` int(11) NOT NULL,
`idDono` int(11) NOT NULL,
`pergunta` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4
CREATE TABLE `enquete_resposta` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idEnqueteResposta` int(11) NOT NULL,
`idEnquete` int(11) NOT NULL,
`idDono` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4
CREATE TABLE
`mensagem` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_turma` int(11) NOT NULL,
`id_user_enviou` int(11) NOT NULL,
`id_user_recebeu` int(11) NOT NULL,
`texto` longtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4