Skip to content
This repository has been archived by the owner on Apr 21, 2024. It is now read-only.

Commit

Permalink
fix: add missing types in guild_event
Browse files Browse the repository at this point in the history
  • Loading branch information
GetPsyched committed Dec 5, 2023
1 parent eda6721 commit 842770f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions database/schemas/guild.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ CREATE TABLE IF NOT EXISTS affiliated_guild (
);

CREATE TABLE IF NOT EXISTS guild_event (
guild_id BIGINT REFERENCES guild(id),
event_type VARCHAR(5) NOT NULL,
channel_id BIGINT NOT NULL,
guild_id BIGINT REFERENCES guild(id),
event_type VARCHAR(7) NOT NULL,
channel_id BIGINT NOT NULL,
message VARCHAR,
PRIMARY KEY (guild_id, event_type),
CONSTRAINT ck_event_type CHECK (
event_type IN ('ban', 'kick', 'leave')
event_type IN ('ban', 'join', 'kick', 'leave', 'welcome')
),
CONSTRAINT ck_message CHECK (
event_type <> 'welcome' OR message IS NOT NULL
)
);

0 comments on commit 842770f

Please sign in to comment.