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
| -- tblCours contient des informations sur les familles déclinées de tblActivite
-- ex : loi des noeuds, loi des mailles, ...
CREATE TABLE IF NOT EXISTS tblCours(
id int(255) unsigned not null auto_increment,
nom varchar(200),
commentaire varchar(250) DEFAULT '',
id_activite int(255) unsigned not null,
ordre int(255) unsigned default 0,
date_creation DATETIME DEFAULT "0000-00-00 00:00:00.0",
PRIMARY KEY(id),
INDEX (id_activite),
FOREIGN KEY (id_activite) REFERENCES tblActivite(id)
ON DELETE CASCADE
ON UPDATE CASCADE
)TYPE=INNODB;
--Table détaillant le contenu du cours
CREATE TABLE IF NOT EXISTS tblCoursDetail(
id int(255) unsigned not null auto_increment,
id_cours int(255) unsigned not null,
id_createur int(255) unsigned not null,
date_lastmodif DATETIME DEFAULT "0000-00-00 00:00:00.0",
contenu TEXT,
PRIMARY KEY(id),
INDEX (id_cours),
FOREIGN KEY (id_cours) REFERENCES tblCours(id)
ON DELETE CASCADE
ON UPDATE CASCADE
)TYPE=INNODB;
-- tblTest contient des informations en lien avec le cours (
--Différents tests en lien avec le cours
CREATE TABLE IF NOT EXISTS tblTest(
id int(255) unsigned not null auto_increment,
nom varchar(200),
commentaire varchar(250) DEFAULT '',
id_cours int(255) unsigned not null,
type_test int(10) unsigned ,
date_creation DATETIME DEFAULT "0000-00-00 00:00:00.0",
PRIMARY KEY(id),
INDEX (id_cours),
FOREIGN KEY (id_cours) REFERENCES tblCours(id)
ON DELETE CASCADE
ON UPDATE CASCADE
)TYPE=INNODB;
-- tblAdherent contient des informations sur les utilisateurs de toutes sortes du site (administrateurs, créateurs, élèves, ...)
CREATE TABLE IF NOT EXISTS `tbladherent` (
`id` int(255) unsigned NOT NULL auto_increment,
`titre` varchar(10) collate latin1_general_ci NOT NULL default 'm',
`nom` varchar(100) collate latin1_general_ci NOT NULL,
`prenom` varchar(100) collate latin1_general_ci NOT NULL,
`adresse` varchar(100) collate latin1_general_ci NOT NULL,
`cp` int(10) unsigned NOT NULL,
`ville` varchar(100) collate latin1_general_ci NOT NULL,
`email` varchar(100) collate latin1_general_ci NOT NULL,
`anniversaire` DATETIME "0000-00-00 00:00:00.0",
PRIMARY KEY (`id`)
); |
Partager