SponsorBlockServer/databases/_sponsorTimes.db.sql

90 lines
2.2 KiB
MySQL
Raw Normal View History

2019-08-21 23:05:08 +02:00
BEGIN TRANSACTION;
2020-04-30 02:56:34 +02: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;
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,
"shadowHidden" INTEGER NOT NULL
);
2021-06-25 05:44:08 +02: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
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
);
2023-01-28 19:09:04 +01:00
CREATE TABLE IF NOT EXISTS "shadowBannedIPs" (
"hashedIP" TEXT NOT NULL PRIMARY KEY
);
CREATE TABLE IF NOT EXISTS "config" (
2021-06-25 05:44:08 +02:00
"key" TEXT NOT NULL UNIQUE,
"value" TEXT NOT NULL
);
2022-12-23 22:56:27 +01:00
CREATE TABLE IF NOT EXISTS "titles" (
"videoID" TEXT NOT NULL,
"title" TEXT NOT NULL,
"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,
"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,
"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
COMMIT;