-
Notifications
You must be signed in to change notification settings - Fork 0
/
jpo.sql
29 lines (26 loc) · 1005 Bytes
/
jpo.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- DROP DATABASE IF EXISTS jpo;
-- CREATE DATABASE IF not EXISTS jpo;
-- USE jpo;
CREATE TABLE IF NOT EXISTS user (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
group_name VARCHAR(255) UNIQUE NOT NULL,
players1 VARCHAR(255) UNIQUE NOT NULL,
players2 VARCHAR(255) UNIQUE NOT NULL,
players3 VARCHAR(255) UNIQUE NOT NULL,
players4 VARCHAR(255) UNIQUE NOT NULL,
players5 VARCHAR(255) UNIQUE NOT NULL,
players6 VARCHAR(255) UNIQUE NOT NULL,
players7 VARCHAR(255) UNIQUE NOT NULL,
players8 VARCHAR(255) UNIQUE NOT NULL,
players9 VARCHAR(255) UNIQUE NOT NULL,
players10 VARCHAR(255) UNIQUE NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS jeu (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
group_name VARCHAR(255) NOT NULL,
points BIGINT NOT NULL,
answers TEXT NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (group_name) REFERENCES user(group_name)
);