-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
97 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
-- upgrade -- | ||
CREATE TABLE IF NOT EXISTS "commands" ( | ||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
"type" TEXT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"category" TEXT NOT NULL, | ||
"description" TEXT, | ||
"content" TEXT NOT NULL, | ||
"url" TEXT, | ||
"uses" BIGINT NOT NULL DEFAULT 0, | ||
"ownerId" BIGINT NOT NULL, | ||
"createdAt" TIMESTAMP NOT NULL, | ||
"visibility" INT NOT NULL DEFAULT 0, | ||
"enabled" INT NOT NULL DEFAULT 1 | ||
); | ||
CREATE TABLE IF NOT EXISTS "guilds" ( | ||
"id" BIGINT NOT NULL PRIMARY KEY | ||
); | ||
CREATE TABLE IF NOT EXISTS "caseLog" ( | ||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
"caseId" BIGINT NOT NULL, | ||
"type" TEXT NOT NULL, | ||
"modId" BIGINT NOT NULL, | ||
"targetId" BIGINT NOT NULL, | ||
"reason" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP NOT NULL, | ||
"guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE | ||
); | ||
CREATE TABLE IF NOT EXISTS "commandsLookup" ( | ||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"cmd_id" BIGINT NOT NULL REFERENCES "commands" ("id") ON DELETE CASCADE, | ||
"guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE | ||
); | ||
CREATE TABLE IF NOT EXISTS "disabled" ( | ||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
"command" TEXT NOT NULL, | ||
"guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE | ||
); | ||
CREATE TABLE IF NOT EXISTS "guildChannels" ( | ||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
"welcomeCh" BIGINT, | ||
"farewellCh" BIGINT, | ||
"modlogCh" BIGINT, | ||
"purgatoryCh" BIGINT, | ||
"announcementCh" BIGINT, | ||
"guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE | ||
); | ||
CREATE TABLE IF NOT EXISTS "guildConfigs" ( | ||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
"ccMode" INT NOT NULL DEFAULT 0, | ||
"tagMode" INT NOT NULL DEFAULT 0, | ||
"welcomeMsg" TEXT, | ||
"farewellMsg" TEXT, | ||
"guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE | ||
); | ||
CREATE TABLE IF NOT EXISTS "guildMutes" ( | ||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
"mutedId" BIGINT NOT NULL, | ||
"guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE | ||
); | ||
CREATE TABLE IF NOT EXISTS "guildRoles" ( | ||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
"modRole" BIGINT, | ||
"mutedRole" BIGINT, | ||
"autoRole" BIGINT, | ||
"guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE | ||
); | ||
CREATE TABLE IF NOT EXISTS "prefixes" ( | ||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
"prefix" TEXT NOT NULL, | ||
"guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE | ||
); | ||
CREATE TABLE IF NOT EXISTS "timer" ( | ||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
"event" TEXT NOT NULL, | ||
"extra" JSON NOT NULL, | ||
"expires" TIMESTAMP NOT NULL, | ||
"created" TIMESTAMP NOT NULL, | ||
"owner" BIGINT NOT NULL | ||
); | ||
CREATE TABLE IF NOT EXISTS "aerich" ( | ||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | ||
"version" VARCHAR(255) NOT NULL, | ||
"app" VARCHAR(20) NOT NULL, | ||
"content" JSON NOT NULL | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters