Added sql schemas

This commit is contained in:
Ajay Ramachandran 2019-08-21 17:05:08 -04:00
parent 69258587bc
commit a6b166588f
3 changed files with 36 additions and 1 deletions

3
.gitignore vendored
View file

@ -88,4 +88,5 @@ typings/
.dynamodb/ .dynamodb/
# Databases # Databases
databases databases/sponsorTimes.db
databases/private.db

13
databases/_private.db.sql Normal file
View file

@ -0,0 +1,13 @@
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "votes" (
"UUID" TEXT NOT NULL,
"userID" INTEGER NOT NULL,
"hashedIP" INTEGER NOT NULL,
"type" INTEGER NOT NULL
);
CREATE TABLE IF NOT EXISTS "sponsorTimes" (
"videoID" TEXT NOT NULL,
"hashedIP" TEXT NOT NULL,
"timeSubmitted" INTEGER NOT NULL
);
COMMIT;

View file

@ -0,0 +1,21 @@
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "userNames" (
"userID" TEXT NOT NULL,
"userName" TEXT NOT NULL
);
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
);
CREATE TABLE IF NOT EXISTS "votes" (
"userID" TEXT NOT NULL,
"UUID" TEXT NOT NULL,
"type" INTEGER NOT NULL
);
COMMIT;