Skip to content
Snippets Groups Projects
Commit 0dfe2e04 authored by LAMINO-HARO FERNANDO-JOEL's avatar LAMINO-HARO FERNANDO-JOEL
Browse files

Upload New File by Lahad

parent 11dd500d
No related merge requests found
drop table if exists Jouer;
drop table if exists Joueur;
drop table if exists Partie;
create table Jouer
(
id_joueur INT NOT NULL,
id_partie INT NOT NULL,
rang VARCHAR(30),
primary key (id_joueur, id_partie)
);
CREATE TABLE Joueur (
id_joueur INT NOT NULL AUTO_INCREMENT,
pseudo VARCHAR(30) NOT NULL,
email VARCHAR(30) NOT NULL,
password VARCHAR(255) NOT NULL,
verification_code VARCHAR(30) NOT NULL UNIQUE,
verified INT DEFAULT 0,
nbVictoire INT DEFAULT 0,
nbDefaite INT DEFAULT 0,
nbMatch INT DEFAULT 0,
score INT DEFAULT 0,
isConnected INT DEFAULT 0,
constraint UC_Joueur UNIQUE (pseudo, email),
PRIMARY KEY (id_joueur)
);
create table Partie
(
id_partie INT NOT NULL AUTO_INCREMENT,
duree INT,
primary key (id_partie)
);
alter table Jouer add constraint fk_Jouer foreign key (id_joueur) references Joueur (id_joueur) on delete cascade on update cascade;
alter table Jouer add constraint fk_Jouer2 foreign key (id_partie) references Partie (id_partie) on delete cascade on update cascade;
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