Update ElectionCycle to ElectionName in database creation script.
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user