Commit 10fffb9a authored by quentin.vrel's avatar quentin.vrel

TP agl

parent 83b984e6
/*==============================================================*/ /*==============================================================*/
/* Nom de SGBD : MySQL 5.0 */ /* Nom de SGBD : MySQL 5.0 */
/* Date de cration : 23/11/2020 17:07:49 */ /* Date de cration : 23/11/2020 18:08:41 */
/*==============================================================*/ /*==============================================================*/
alter table MJ_GAME
drop foreign key FK_MJ_GAME_HOST_MJ_SALON;
alter table MJ_PLAY
drop foreign key FK_MJ_PLAY_PLAY_MJ_GAME;
alter table MJ_PLAY
drop foreign key FK_MJ_PLAY_PLAY2_MJ_USER;
alter table MJ_ROUND
drop foreign key FK_MJ_ROUND_COMPOSE_MJ_GAME;
alter table MJ_SALON
drop foreign key FK_MJ_SALON_CREATION_MJ_USER;
alter table MJ_USER
drop foreign key FK_MJ_USER_HAS_MJ_ROLE;
drop table if exists MJ_BLACKLIST_IP;
alter table MJ_GAME
drop foreign key FK_MJ_GAME_HOST_MJ_SALON;
drop table if exists MJ_GAME;
alter table MJ_PLAY
drop foreign key FK_MJ_PLAY_PLAY_MJ_GAME;
alter table MJ_PLAY
drop foreign key FK_MJ_PLAY_PLAY2_MJ_USER;
drop table if exists MJ_PLAY;
drop table if exists MJ_ROLE;
alter table MJ_ROUND
drop foreign key FK_MJ_ROUND_COMPOSE_MJ_GAME;
drop table if exists MJ_ROUND;
alter table MJ_SALON
drop foreign key FK_MJ_SALON_CREATION_MJ_USER;
drop table if exists MJ_SALON;
alter table MJ_USER
drop foreign key FK_MJ_USER_HAS_MJ_ROLE;
drop table if exists MJ_USER;
/*==============================================================*/ /*==============================================================*/
/* Table : MJ_BLACKLIST_IP */ /* Table : MJ_BLACKLIST_IP */
/*==============================================================*/ /*==============================================================*/
...@@ -71,100 +16,93 @@ create table MJ_BLACKLIST_IP ...@@ -71,100 +16,93 @@ create table MJ_BLACKLIST_IP
); );
/*==============================================================*/ /*==============================================================*/
/* Table : MJ_GAME */ /* Table : MJ_ROLE */
/*==============================================================*/ /*==============================================================*/
create table MJ_GAME create table MJ_ROLE
( (
ID_GAME int not null auto_increment comment '', ID_ROLE int not null auto_increment comment '',
ID_ROOM varchar(1024) not null comment '', NAME varchar(15) not null comment '',
DATE_BEGIN datetime not null comment '', primary key (ID_ROLE)
DATE_END datetime comment '',
primary key (ID_GAME)
); );
/*==============================================================*/ /*==============================================================*/
/* Table : MJ_PLAY */ /* Table : MJ_USER */
/*==============================================================*/ /*==============================================================*/
create table MJ_PLAY create table MJ_USER
( (
ID_GAME int not null comment '', ID_USER int not null auto_increment comment '',
ID_USER int not null comment '', ID_ROLE int comment '',
WIN bool comment '', LOGIN varchar(16) not null comment '',
primary key (ID_GAME, ID_USER) PASWORD char(40) not null comment '',
AVATAR char(255) comment '',
LASTNAME char(55) comment '',
FIRSTNAME char(55) comment '',
MAIL char(64) not null comment '',
BAN_ACCOUNT bool comment '',
LAST_IP varchar(15) comment '',
primary key (ID_USER),
constraint FK_MJ_USER_MJ_HAS_MJ_ROLE foreign key (ID_ROLE)
references MJ_ROLE (ID_ROLE) on delete restrict on update restrict
); );
/*==============================================================*/ /*==============================================================*/
/* Table : MJ_ROLE */ /* Table : MJ_ROOM */
/*==============================================================*/ /*==============================================================*/
create table MJ_ROLE create table MJ_ROOM
( (
ID_ROLE int not null auto_increment comment '', ID_ROOM int not null auto_increment comment '',
NAME varchar(15) not null comment '', ID_USER int comment '',
primary key (ID_ROLE) PRIVATE bool not null comment '',
DATE_BEGIN datetime not null comment '',
DATE_END datetime comment '',
primary key (ID_ROOM),
constraint FK_MJ_ROOM_MJ_CREATI_MJ_USER foreign key (ID_USER)
references MJ_USER (ID_USER) on delete restrict on update restrict
); );
/*==============================================================*/ /*==============================================================*/
/* Table : MJ_ROUND */ /* Table : MJ_GAME */
/*==============================================================*/ /*==============================================================*/
create table MJ_ROUND create table MJ_GAME
( (
ID_ROUND int not null auto_increment comment '', ID_GAME int not null auto_increment comment '',
ID_GAME int not null comment '', ID_ROOM int comment '',
WIND int not null comment '',
SEED int not null comment '',
DATE_BEGIN datetime not null comment '', DATE_BEGIN datetime not null comment '',
DATE_END datetime comment '', DATE_END datetime comment '',
ACTIONS varchar(500) comment '', primary key (ID_GAME),
primary key (ID_ROUND) constraint FK_MJ_GAME_MJ_HOST_MJ_ROOM foreign key (ID_ROOM)
references MJ_ROOM (ID_ROOM) on delete restrict on update restrict
); );
/*==============================================================*/ /*==============================================================*/
/* Table : MJ_SALON */ /* Table : MJ_PLAY */
/*==============================================================*/ /*==============================================================*/
create table MJ_SALON create table MJ_PLAY
( (
ID_ROOM int not null auto_increment comment '', ID_GAME int not null comment '',
ID_USER int not null comment '', ID_USER int not null comment '',
PRIVATE bool not null comment '', WIN bool comment '',
DATE_BEGIN datetime not null comment '', primary key (ID_GAME, ID_USER),
DATE_END datetime comment '', constraint FK_MJ_PLAY_PLAY_MJ_GAME foreign key (ID_GAME)
CODE char(6) comment '', references MJ_GAME (ID_GAME) on delete restrict on update restrict,
primary key (ID_ROOM) constraint FK_MJ_PLAY_PLAY2_MJ_USER foreign key (ID_USER)
references MJ_USER (ID_USER) on delete restrict on update restrict
); );
/*==============================================================*/ /*==============================================================*/
/* Table : MJ_USER */ /* Table : MJ_ROUND */
/*==============================================================*/ /*==============================================================*/
create table MJ_USER create table MJ_ROUND
( (
ID_USER int not null auto_increment comment '', ID_ROUND int not null auto_increment comment '',
ID_ROLE int not null comment '', ID_GAME int comment '',
LOGIN varchar(16) not null comment '', WIND int not null comment '',
PASWORD char(40) not null comment '', SEED int not null comment '',
AVATAR char(1024) comment '', DATE_BEGIN datetime not null comment '',
LASTNAME char(55) comment '', DATE_END datetime comment '',
FIRSTNAME char(55) comment '', ACTIONS text comment '',
MAIL char(64) not null comment '', primary key (ID_ROUND),
BAN_ACCOUNT bool comment '', constraint FK_MJ_ROUND_MJ_COMPOS_MJ_GAME foreign key (ID_GAME)
LAST_IP varchar(15) comment '', references MJ_GAME (ID_GAME) on delete restrict on update restrict
primary key (ID_USER)
); );
alter table MJ_GAME add constraint FK_MJ_GAME_HOST_MJ_SALON foreign key (ID_ROOM)
references MJ_SALON (ID_ROOM) on delete restrict on update restrict;
alter table MJ_PLAY add constraint FK_MJ_PLAY_PLAY_MJ_GAME foreign key (ID_GAME)
references MJ_GAME (ID_GAME) on delete restrict on update restrict;
alter table MJ_PLAY add constraint FK_MJ_PLAY_PLAY2_MJ_USER foreign key (ID_USER)
references MJ_USER (ID_USER) on delete restrict on update restrict;
alter table MJ_ROUND add constraint FK_MJ_ROUND_COMPOSE_MJ_GAME foreign key (ID_GAME)
references MJ_GAME (ID_GAME) on delete restrict on update restrict;
alter table MJ_SALON add constraint FK_MJ_SALON_CREATION_MJ_USER foreign key (ID_USER)
references MJ_USER (ID_USER) on delete restrict on update restrict;
alter table MJ_USER add constraint FK_MJ_USER_HAS_MJ_ROLE foreign key (ID_ROLE)
references MJ_ROLE (ID_ROLE) on delete restrict on update restrict;
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<Workspace> <Workspace>
<Local Expanded="Yes"> <Local Expanded="Yes">
<Model Expanded="Yes" ID="{11E4B893-61D4-478A-BAF1-0F640FC9D025}" Name="MCD TP AGL" Type="{1E597170-9350-11D1-AB3C-0020AF71E433}" URL="MCD TP AGL.mcd"/> <Model Expanded="Yes" ID="{11E4B893-61D4-478A-BAF1-0F640FC9D025}" Name="MCD TP AGL" Type="{1E597170-9350-11D1-AB3C-0020AF71E433}" URL="MCD TP AGL.mcd"/>
<Model Expanded="Yes" ID="{83E9595C-80F2-4C36-B14E-147FEB75C299}" Name="MPD_TP_AGL" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" URL="MPD TP AGL.mpd"/> <Model Expanded="Yes" ID="{429C6A8D-7CCA-4EA9-9518-24D9C8D1C5AC}" Name="MPD TP AGL" Selected="Yes" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" URL="MPD TP AGL.mpd"/>
</Local> </Local>
<BrowserModule Name="Repository"/> <BrowserModule Name="Repository"/>
</Workspace> </Workspace>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment