create table recruits
(
    discord_id bigint      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 bigint   not null,
    discord_id_voter   bigint   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 settings
(
    name  varchar(40)      not null,
    value int(20) unsigned not null
);

create table yes_votes
(
    id                 int auto_increment
        primary key,
    discord_id_recruit bigint not null,
    discord_id_voter   bigint not null,
    constraint yes_votes_pk2
        unique (id),
    constraint yes_votes_recruits_discord_id_fk
        foreign key (discord_id_recruit) references recruits (discord_id)
);

INSERT INTO settings (name, value) VALUES ("channel_voting", "");