dump.sql 3.86 KB
Newer Older
quentin.vrel's avatar
quentin.vrel committed
1 2
/*==============================================================*/
/* Nom de SGBD :  MySQL 5.0                                     */
Zohten's avatar
Zohten committed
3
/* Date de cr�ation :  24/11/2020 16:14:35                      */
quentin.vrel's avatar
quentin.vrel committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*==============================================================*/


/*==============================================================*/
/* 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)
);

quentin.vrel's avatar
quentin.vrel committed
18 19 20 21 22 23 24 25 26 27 28
/*==============================================================*/
/* 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)
);

quentin.vrel's avatar
quentin.vrel committed
29
/*==============================================================*/
quentin.vrel's avatar
quentin.vrel committed
30
/* Table : MJ_ROLE                                              */
quentin.vrel's avatar
quentin.vrel committed
31
/*==============================================================*/
quentin.vrel's avatar
quentin.vrel committed
32
create table MJ_ROLE
quentin.vrel's avatar
quentin.vrel committed
33
(
quentin.vrel's avatar
quentin.vrel committed
34 35 36
   ID_ROLE              int not null auto_increment  comment '',
   NAME                 varchar(15) not null  comment '',
   primary key (ID_ROLE)
quentin.vrel's avatar
quentin.vrel committed
37 38 39
);

/*==============================================================*/
quentin.vrel's avatar
quentin.vrel committed
40
/* Table : MJ_USER                                              */
quentin.vrel's avatar
quentin.vrel committed
41
/*==============================================================*/
quentin.vrel's avatar
quentin.vrel committed
42
create table MJ_USER
quentin.vrel's avatar
quentin.vrel committed
43
(
quentin.vrel's avatar
quentin.vrel committed
44 45 46
   ID_USER              int not null auto_increment  comment '',
   ID_ROLE              int  comment '',
   LOGIN                varchar(16) not null  comment '',
Zohten's avatar
Zohten committed
47
   PASWORD              char(80) not null  comment '',
quentin.vrel's avatar
quentin.vrel committed
48 49 50 51 52 53 54 55 56
   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
quentin.vrel's avatar
quentin.vrel committed
57 58 59
);

/*==============================================================*/
quentin.vrel's avatar
quentin.vrel committed
60
/* Table : MJ_ROUND                                             */
quentin.vrel's avatar
quentin.vrel committed
61
/*==============================================================*/
quentin.vrel's avatar
quentin.vrel committed
62
create table MJ_ROUND
quentin.vrel's avatar
quentin.vrel committed
63
(
quentin.vrel's avatar
quentin.vrel committed
64 65 66 67 68 69 70 71 72 73
   ID_ROUND             int not null auto_increment  comment '',
   ID_GAME              int  comment '',
   PREVAILING_WIND      int not null  comment '',
   SEED                 int not null  comment '',
   BEGINING             timestamp  comment '',
   ENDING               timestamp  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
quentin.vrel's avatar
quentin.vrel committed
74 75 76
);

/*==============================================================*/
quentin.vrel's avatar
quentin.vrel committed
77
/* Table : MJ_PLAY                                              */
quentin.vrel's avatar
quentin.vrel committed
78
/*==============================================================*/
quentin.vrel's avatar
quentin.vrel committed
79
create table MJ_PLAY
quentin.vrel's avatar
quentin.vrel committed
80 81
(
   ID_USER              int not null  comment '',
quentin.vrel's avatar
quentin.vrel committed
82
   ID_ROUND             int not null  comment '',
quentin.vrel's avatar
quentin.vrel committed
83
   WIN                  bool  comment '',
quentin.vrel's avatar
quentin.vrel committed
84 85 86 87
   SCORE                int  comment '',
   HOST                 bool  comment '',
   WIND                 int  comment '',
   primary key (ID_USER, ID_ROUND),
quentin.vrel's avatar
quentin.vrel committed
88
   constraint FK_MJ_PLAY_PLAY2_MJ_USER foreign key (ID_USER)
Zohten's avatar
Zohten committed
89
      references MJ_USER (ID_USER) on delete restrict on update cascade,
quentin.vrel's avatar
quentin.vrel committed
90
   constraint FK_MJ_PLAY_MJ_PLAY_MJ_ROUND foreign key (ID_ROUND)
Zohten's avatar
Zohten committed
91
      references MJ_ROUND (ID_ROUND) on delete restrict on update cascade
quentin.vrel's avatar
quentin.vrel committed
92 93
);