-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.sql
86 lines (73 loc) · 2.32 KB
/
database.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
use chirokasterlee_;
drop table if exists new_leiding_functie;
drop table if exists new_afbeelding;
drop table if exists new_functies;
drop table if exists new_leiding;
drop table if exists new_nieuws;
drop table if exists new_programmas;
drop table if exists new_kalender;
drop table if exists new_kamp;
drop table if exists new_login;
create table new_leiding (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
chiro char not null,
naam varchar(100) not null,
mail varchar(100) not null,
groep char not null,
afbeeldingId int not null
) engine=innodb;
create table new_functies (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
omschrijving varchar(100) not null,
leidingId INT NOT NULL
)engine=innodb;
create table new_nieuws (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
datum date not null,
bericht varchar(100) not null
) engine=innodb;
create table new_programmas (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
chiro char not null,
datum date not null,
groep char not null,
programma varchar(100) not null
) engine=innodb;
create table new_kalender (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
chiro char not null,
datum date not null,
activiteit varchar(100) not null
) engine=innodb;
create table new_kamp (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
chiro char not null,
tekst varchar(5000) not null
) engine=innodb;
create table new_login (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
login varchar(20) not null,
wachtwoord varchar(32) not null,
chiro char not null
) engine=innodb;
create table new_afbeelding (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
type varchar(20) not null,
data mediumblob not null
) engine=innodb;
create table new_verhuur (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
chiro char not null,
tekst varchar(5000) not null
) engine=innodb;
create table new_chirofeesten (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
tekst varchar(5000) not null
) engine=innodb;
create table new_contact (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
tekst varchar(5000) not null
) engine=innodb;
alter table new_leiding ADD CONSTRAINT fk_1 FOREIGN KEY (afbeeldingId) REFERENCES new_afbeelding (id);
alter table new_leiding_functie ADD CONSTRAINT fk_2 FOREIGN KEY (functieId) REFERENCES new_functies (id);
alter table new_leiding_functie ADD CONSTRAINT fk_3 FOREIGN KEY (leidingId) REFERENCES new_leiding (id);