From 306e0d687a8d3f875b017f4defbe854efd3c6e08 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Tue, 3 Sep 2024 11:10:10 -0400 Subject: [PATCH] Update ElectionCycle to ElectionName in database creation script. --- database_setup/database.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/database_setup/database.sql b/database_setup/database.sql index 17d7368..bffac4d 100644 --- a/database_setup/database.sql +++ b/database_setup/database.sql @@ -1,15 +1,15 @@ CREATE TABLE ElectionInformation( - ElectionCycle varchar(30) not null unique, + ElectionName varchar(30) not null unique, ThreadId bigint unsigned not null, CouncilVoteMsgId bigint unsigned, HighCouncilVoteMsgId bigint unsigned, CouncilNominationMsgId bigint unsigned, HighCouncilNominationMsgId bigint unsigned, - PRIMARY KEY (ElectionCycle) + PRIMARY KEY (ElectionName) ); CREATE TABLE CouncilMembers( - ElectionCycle varchar(30) not null, + ElectionName varchar(30) not null, MemberId bigint unsigned not null, SpeechMsgId bigint unsigned not null, Elected boolean DEFAULT false, @@ -17,17 +17,17 @@ CREATE TABLE CouncilMembers( ClanLeader boolean DEFAULT false, DiscordManagerSpeechId bigint unsigned, ClanLeaderSpeechId bigint unsigned, - FOREIGN KEY (ElectionCycle) REFERENCES ElectionInformation(ElectionCycle), - PRIMARY KEY (ElectionCycle, MemberId) + FOREIGN KEY (ElectionName) REFERENCES ElectionInformation(ElectionName), + PRIMARY KEY (ElectionName, MemberId) ); CREATE TABLE Votes( - ElectionCycle varchar(30) not null, + ElectionName varchar(30) not null, VoterId bigint unsigned not null, VotedForId bigint unsigned, Type varchar(14) not null DEFAULT 'council' check("Type" in ('council', 'discordmanager', 'clanleader')), - FOREIGN KEY (ElectionCycle) REFERENCES ElectionInformation(ElectionCycle), - PRIMARY KEY (ElectionCycle, VoterId, Type) + FOREIGN KEY (ElectionName) REFERENCES ElectionInformation(ElectionName), + PRIMARY KEY (ElectionName, VoterId, Type) ); CREATE TABLE UserBirthday (