Commit 83b984e6 authored by quentin.vrel's avatar quentin.vrel

TP AGL 23/11

parent 7ee0eac9
/*==============================================================*/
/* Nom de SGBD : MySQL 5.0 */
/* Date de cration : 23/11/2020 17:07:49 */
/*==============================================================*/
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 */
/*==============================================================*/
create table MJ_BLACKLIST_IP
(
ID_BLACKLIST int not null auto_increment comment '',
IP varchar(15) not null comment '',
DATE_BAN datetime not null comment '',
primary key (ID_BLACKLIST)
);
/*==============================================================*/
/* Table : MJ_GAME */
/*==============================================================*/
create table MJ_GAME
(
ID_GAME int not null auto_increment comment '',
ID_ROOM varchar(1024) not null comment '',
DATE_BEGIN datetime not null comment '',
DATE_END datetime comment '',
primary key (ID_GAME)
);
/*==============================================================*/
/* Table : MJ_PLAY */
/*==============================================================*/
create table MJ_PLAY
(
ID_GAME int not null comment '',
ID_USER int not null comment '',
WIN bool comment '',
primary key (ID_GAME, ID_USER)
);
/*==============================================================*/
/* Table : MJ_ROLE */
/*==============================================================*/
create table MJ_ROLE
(
ID_ROLE int not null auto_increment comment '',
NAME varchar(15) not null comment '',
primary key (ID_ROLE)
);
/*==============================================================*/
/* Table : MJ_ROUND */
/*==============================================================*/
create table MJ_ROUND
(
ID_ROUND int not null auto_increment comment '',
ID_GAME int not null comment '',
WIND int not null comment '',
SEED int not null comment '',
DATE_BEGIN datetime not null comment '',
DATE_END datetime comment '',
ACTIONS varchar(500) comment '',
primary key (ID_ROUND)
);
/*==============================================================*/
/* Table : MJ_SALON */
/*==============================================================*/
create table MJ_SALON
(
ID_ROOM int not null auto_increment comment '',
ID_USER int not null comment '',
PRIVATE bool not null comment '',
DATE_BEGIN datetime not null comment '',
DATE_END datetime comment '',
CODE char(6) comment '',
primary key (ID_ROOM)
);
/*==============================================================*/
/* Table : MJ_USER */
/*==============================================================*/
create table MJ_USER
(
ID_USER int not null auto_increment comment '',
ID_ROLE int not null comment '',
LOGIN varchar(16) not null comment '',
PASWORD char(40) not null comment '',
AVATAR char(1024) 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)
);
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;
<?xml version="1.0" encoding="UTF-8"?>
<?PowerDesigner signature="Workspace" version="16.7.1.6521"?>
<!-- Veuillez ne pas modifier ce fichier -->
<Workspace>
<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="{83E9595C-80F2-4C36-B14E-147FEB75C299}" Name="MPD_TP_AGL" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" URL="MPD TP AGL.mpd"/>
</Local>
<BrowserModule Name="Repository"/>
</Workspace>
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