-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbdd
121 lines (94 loc) · 3.47 KB
/
bdd
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
drop database eSLIDES;
Create database eSLIDES;
use eSLIDES;
create table codeBaps (
id int auto_increment,
libelleCodeBaps varchar(256) not null unique,
primary key (id)
)
ENGINE=InnoDB;
create table codeRayhane (
id int auto_increment,
codeRayhane varchar(256) not null unique,
primary key (id)
)
ENGINE = INNODB;
Create table stockerPageDeGarde (
id int auto_increment,
dateInjection timestamp not null default current_timestamp,
derniereModification timestamp not null default current_timestamp on update current_timestamp,
emplacement varchar(256) not null,
libelle varchar(256) not null unique,
primary key(id)
)
ENGINE = InnoDb;
Create table supportCoursGen (
id int auto_increment,
dateGeneration timestamp not null default current_timestamp,
derniereModification timestamp not null default current_timestamp on update current_timestamp,
emplacement varchar(256) not null unique,
supportCoursSource varchar(256),
codeBaps varchar(256),
codeRayhane varchar(256),
primary key (id)
)
ENGINE=InnoDB;
create table supportCoursSource (
id int auto_increment,
dateInjection timestamp not null default current_timestamp,
derniereModification timestamp not null default current_timestamp on update current_timestamp,
emplacement varchar(256) not null unique,
codeBaps varchar(256),
codeRayhane varchar(256),
supportCoursGen varchar(256),
primary key (id)
)
ENGINE=InnoDB;
create table slide (
id int auto_increment,
dateInjection timestamp not null default current_timestamp,
dateDerniereModification timestamp not null default current_timestamp on update current_timestamp,
emplacementFichier varchar(256) not null unique,
codeBaps varchar(256),
codeRayhane varchar(256),
emplacementCsv varchar(256),
emplacementThumbnails varchar(256) unique,
primary key (id)
)
ENGINE=InnoDB;
create table csv (
id int auto_increment,
dateInjection timestamp not null default current_timestamp,
emplacement varchar(256) not null unique,
primary key (id)
)
ENGINE = InnoDB;
create table thumbnails (
id int auto_increment,
dateInjection timestamp not null default current_timestamp,
emplacement varchar(256) not null unique,
primary key (id)
)
ENGINE = InnoDB;
ALTER TABLE supportCoursGen
ADD CONSTRAINT fk_supportCoursGen_supCoursSource FOREIGN KEY (supportCoursSource)
REFERENCES supportCoursSource(emplacement);
ALTER TABLE supportCoursGen
ADD CONSTRAINT fk_supportCoursGen_codeBaps FOREIGN KEY (codeBaps) REFERENCES codeBaps (libelleCodeBaps);
ALTER TABLE supportCoursGen
ADD CONSTRAINT fk_supportCoursGen_codeRayhane FOREIGN KEY (codeRayhane) REFERENCES codeRayhane (codeRayhane);
ALTER TABLE supportCoursSource
ADD CONSTRAINT fk_supportCoursSource_supCoursGen FOREIGN KEY (supportCoursGen)
REFERENCES supportCoursGen(emplacement);
ALTER TABLE supportCoursSource
ADD CONSTRAINT fk_supportCoursSource_codeBaps FOREIGN KEY (codeBaps) REFERENCES codeBaps (libelleCodeBaps);
ALTER TABLE supportCoursSource
ADD CONSTRAINT fk_supportCoursSource_codeRayhane FOREIGN KEY (codeRayhane) REFERENCES codeRayhane (codeRayhane);
alter table slide
add constraint fk_slide_codeBaps foreign key (codeBaps) references codeBaps(libelleCodeBaps);
alter table slide
add constraint fk_slide_codeRayhane foreign key (codeRayhane) references codeRayhane(codeRayhane);
alter table slide
add constraint fk_slide_emplacementCsv foreign key (emplacementCsv) references csv(emplacement);
alter table slide
add constraint fk_slide_emplacementThumbnails foreign key (emplacementThumbnails) references thumbnails(emplacement);