Commit 95ed4c6f authored by quentin.vrel's avatar quentin.vrel

Mise à jour de la bdd

parent b2de3b6f
/*==============================================================*/ /*==============================================================*/
/* Nom de SGBD : MySQL 5.0 */ /* Nom de SGBD : MySQL 5.0 */
/* Date de cration : 23/11/2020 18:08:41 */ /* Date de cration : 24/11/2020 16:14:35 */
/*==============================================================*/ /*==============================================================*/
...@@ -15,6 +15,17 @@ create table MJ_BLACKLIST_IP ...@@ -15,6 +15,17 @@ create table MJ_BLACKLIST_IP
primary key (ID_BLACKLIST) primary key (ID_BLACKLIST)
); );
/*==============================================================*/
/* Table : MJ_GAME */
/*==============================================================*/
create table MJ_GAME
(
ID_GAME int not null auto_increment comment '',
PRIVATE bool not null comment '',
CREATION_TIME timestamp not null comment '',
primary key (ID_GAME)
);
/*==============================================================*/ /*==============================================================*/
/* Table : MJ_ROLE */ /* Table : MJ_ROLE */
/*==============================================================*/ /*==============================================================*/
...@@ -46,32 +57,20 @@ create table MJ_USER ...@@ -46,32 +57,20 @@ create table MJ_USER
); );
/*==============================================================*/ /*==============================================================*/
/* Table : MJ_ROOM */ /* Table : MJ_ROUND */
/*==============================================================*/
create table MJ_ROOM
(
ID_ROOM int not null auto_increment comment '',
ID_USER int comment '',
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_GAME */
/*==============================================================*/ /*==============================================================*/
create table MJ_GAME create table MJ_ROUND
( (
ID_GAME int not null auto_increment comment '', ID_ROUND int not null auto_increment comment '',
ID_ROOM int comment '', ID_GAME int comment '',
DATE_BEGIN datetime not null comment '', PREVAILING_WIND int not null comment '',
DATE_END datetime comment '', SEED int not null comment '',
primary key (ID_GAME), BEGINING timestamp comment '',
constraint FK_MJ_GAME_MJ_HOST_MJ_ROOM foreign key (ID_ROOM) ENDING timestamp comment '',
references MJ_ROOM (ID_ROOM) on delete restrict on update restrict ACTIONS text comment '',
primary key (ID_ROUND),
constraint FK_MJ_ROUND_MJ_COMPOS_MJ_GAME foreign key (ID_GAME)
references MJ_GAME (ID_GAME) on delete restrict on update restrict
); );
/*==============================================================*/ /*==============================================================*/
...@@ -79,30 +78,16 @@ create table MJ_GAME ...@@ -79,30 +78,16 @@ create table MJ_GAME
/*==============================================================*/ /*==============================================================*/
create table MJ_PLAY create table MJ_PLAY
( (
ID_GAME int not null comment '',
ID_USER int not null comment '', ID_USER int not null comment '',
ID_ROUND int not null comment '',
WIN bool comment '', WIN bool comment '',
primary key (ID_GAME, ID_USER), SCORE int comment '',
constraint FK_MJ_PLAY_PLAY_MJ_GAME foreign key (ID_GAME) HOST bool comment '',
references MJ_GAME (ID_GAME) on delete restrict on update restrict, WIND int comment '',
primary key (ID_USER, ID_ROUND),
constraint FK_MJ_PLAY_PLAY2_MJ_USER foreign key (ID_USER) constraint FK_MJ_PLAY_PLAY2_MJ_USER foreign key (ID_USER)
references MJ_USER (ID_USER) on delete restrict on update restrict references MJ_USER (ID_USER) on delete restrict on update restrict,
); constraint FK_MJ_PLAY_MJ_PLAY_MJ_ROUND foreign key (ID_ROUND)
references MJ_ROUND (ID_ROUND) on delete restrict on update restrict
/*==============================================================*/
/* Table : MJ_ROUND */
/*==============================================================*/
create table MJ_ROUND
(
ID_ROUND int not null auto_increment comment '',
ID_GAME int comment '',
WIND int not null comment '',
SEED int not null comment '',
DATE_BEGIN datetime not null comment '',
DATE_END datetime comment '',
ACTIONS text comment '',
primary key (ID_ROUND),
constraint FK_MJ_ROUND_MJ_COMPOS_MJ_GAME foreign key (ID_GAME)
references MJ_GAME (ID_GAME) on delete restrict on update restrict
); );
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