Created Tables
This commit is contained in:
50
init.sql
Normal file
50
init.sql
Normal file
@@ -0,0 +1,50 @@
|
||||
create table recruits
|
||||
(
|
||||
discord_id int(20) unsigned not null,
|
||||
nickname varchar(50) null,
|
||||
recruit tinyint(1) not null,
|
||||
id int auto_increment,
|
||||
constraint id
|
||||
unique (id),
|
||||
constraint recruits_pk
|
||||
unique (discord_id)
|
||||
);
|
||||
|
||||
create table no_votes
|
||||
(
|
||||
id int auto_increment
|
||||
primary key,
|
||||
discord_id_recruit int(20) unsigned not null,
|
||||
discord_id_voter int(20) unsigned not null,
|
||||
reason longtext not null,
|
||||
constraint no_votes_pk2
|
||||
unique (id),
|
||||
constraint no_votes_recruits_discord_id_fk
|
||||
foreign key (discord_id_recruit) references recruits (discord_id)
|
||||
);
|
||||
|
||||
create table yes_votes
|
||||
(
|
||||
id int auto_increment
|
||||
primary key,
|
||||
discord_id_recruit int(20) unsigned not null,
|
||||
discord_id_voter int(20) unsigned not null,
|
||||
constraint yes_votes_pk2
|
||||
unique (id),
|
||||
constraint yes_votes_recruits_discord_id_fk
|
||||
foreign key (discord_id_recruit) references recruits (discord_id)
|
||||
on delete cascade
|
||||
);
|
||||
|
||||
create table yes_votes
|
||||
(
|
||||
id int auto_increment
|
||||
primary key,
|
||||
discord_id_recruit int(20) unsigned not null,
|
||||
discord_id_voter int(20) unsigned not null,
|
||||
constraint yes_votes_pk2
|
||||
unique (id),
|
||||
constraint yes_votes_recruits_discord_id_fk
|
||||
foreign key (discord_id_recruit) references recruits (discord_id)
|
||||
on delete cascade
|
||||
);
|
||||
Reference in New Issue
Block a user