2019-08-21 23:05:08 +02:00
|
|
|
BEGIN TRANSACTION;
|
2020-04-30 02:56:34 +02:00
|
|
|
|
2021-03-05 02:23:05 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS "vipUsers" (
|
|
|
|
"userID" TEXT NOT NULL
|
2019-09-17 01:45:39 +02:00
|
|
|
);
|
2021-03-05 01:44:54 +01:00
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
|
|
|
|
BEGIN TRANSACTION;
|
|
|
|
|
2021-03-05 02:23:05 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS "sponsorTimes" (
|
|
|
|
"videoID" TEXT NOT NULL,
|
|
|
|
"startTime" REAL NOT NULL,
|
|
|
|
"endTime" REAL NOT NULL,
|
|
|
|
"votes" INTEGER NOT NULL,
|
|
|
|
"UUID" TEXT NOT NULL UNIQUE,
|
|
|
|
"userID" TEXT NOT NULL,
|
|
|
|
"timeSubmitted" INTEGER NOT NULL,
|
|
|
|
"views" INTEGER NOT NULL,
|
2021-06-25 05:44:08 +02:00
|
|
|
"category" TEXT NOT NULL,
|
2021-03-05 02:23:05 +01:00
|
|
|
"shadowHidden" INTEGER NOT NULL
|
2019-08-22 06:01:27 +02:00
|
|
|
);
|
2021-06-25 05:44:08 +02:00
|
|
|
|
2021-03-05 02:23:05 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS "userNames" (
|
|
|
|
"userID" TEXT NOT NULL,
|
|
|
|
"userName" TEXT NOT NULL
|
2019-09-17 01:45:39 +02:00
|
|
|
);
|
2021-06-25 05:44:08 +02:00
|
|
|
|
2021-03-05 02:23:05 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS "categoryVotes" (
|
|
|
|
"UUID" TEXT NOT NULL,
|
|
|
|
"category" TEXT NOT NULL,
|
|
|
|
"votes" INTEGER NOT NULL default 0
|
2020-04-30 02:56:34 +02:00
|
|
|
);
|
2020-04-28 05:01:51 +02:00
|
|
|
|
2023-01-28 19:09:04 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS "shadowBannedIPs" (
|
|
|
|
"hashedIP" TEXT NOT NULL PRIMARY KEY
|
|
|
|
);
|
|
|
|
|
2021-03-05 02:23:05 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS "config" (
|
2021-06-25 05:44:08 +02:00
|
|
|
"key" TEXT NOT NULL UNIQUE,
|
2021-03-05 02:23:05 +01:00
|
|
|
"value" TEXT NOT NULL
|
2020-04-28 05:01:51 +02:00
|
|
|
);
|
|
|
|
|
2022-12-23 22:56:27 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS "titles" (
|
|
|
|
"videoID" TEXT NOT NULL,
|
|
|
|
"title" TEXT NOT NULL,
|
2023-01-28 08:31:49 +01:00
|
|
|
"original" INTEGER default 0,
|
2022-12-23 22:56:27 +01:00
|
|
|
"userID" TEXT NOT NULL,
|
|
|
|
"service" TEXT NOT NULL,
|
|
|
|
"hashedVideoID" TEXT NOT NULL,
|
|
|
|
"timeSubmitted" INTEGER NOT NULL,
|
|
|
|
"UUID" TEXT NOT NULL PRIMARY KEY
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS "titleVotes" (
|
|
|
|
"UUID" TEXT NOT NULL PRIMARY KEY,
|
|
|
|
"votes" INTEGER NOT NULL default 0,
|
|
|
|
"locked" INTEGER NOT NULL default 0,
|
|
|
|
"shadowHidden" INTEGER NOT NULL default 0,
|
|
|
|
FOREIGN KEY("UUID") REFERENCES "titles"("UUID")
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS "thumbnails" (
|
|
|
|
"videoID" TEXT NOT NULL,
|
|
|
|
"original" INTEGER default 0,
|
|
|
|
"userID" TEXT NOT NULL,
|
|
|
|
"service" TEXT NOT NULL,
|
|
|
|
"hashedVideoID" TEXT NOT NULL,
|
|
|
|
"timeSubmitted" INTEGER NOT NULL,
|
|
|
|
"UUID" TEXT NOT NULL PRIMARY KEY
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS "thumbnailTimestamps" (
|
|
|
|
"UUID" TEXT NOT NULL PRIMARY KEY,
|
2023-01-28 04:36:29 +01:00
|
|
|
"timestamp" INTEGER NOT NULL default 0,
|
2022-12-23 22:56:27 +01:00
|
|
|
FOREIGN KEY("UUID") REFERENCES "thumbnails"("UUID")
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS "thumbnailVotes" (
|
|
|
|
"UUID" TEXT NOT NULL PRIMARY KEY,
|
|
|
|
"votes" INTEGER NOT NULL default 0,
|
|
|
|
"locked" INTEGER NOT NULL default 0,
|
2023-01-28 04:36:29 +01:00
|
|
|
"shadowHidden" INTEGER NOT NULL default 0,
|
2022-12-23 22:56:27 +01:00
|
|
|
FOREIGN KEY("UUID") REFERENCES "thumbnails"("UUID")
|
|
|
|
);
|
|
|
|
|
2021-03-02 04:20:44 +01:00
|
|
|
CREATE EXTENSION IF NOT EXISTS pgcrypto; --!sqlite-ignore
|
2021-10-22 07:05:08 +02:00
|
|
|
CREATE EXTENSION IF NOT EXISTS pg_trgm; --!sqlite-ignore
|
2021-03-02 04:20:44 +01:00
|
|
|
|
2020-03-04 21:17:50 +01:00
|
|
|
COMMIT;
|