Finally finished the massive refactor... transitions still broke but it's fine for now.

This commit is contained in:
2018-10-28 11:23:51 +11:00
parent 8cf714500c
commit d5d0c7edd2
36 changed files with 397 additions and 531 deletions

View File

@ -0,0 +1,5 @@
CREATE TABLE IF NOT EXISTS "Formats" (
"id" BIGSERIAL NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"gameId" BIGSERIAL NOT NULL
);

View File

@ -0,0 +1,4 @@
CREATE TABLE IF NOT EXISTS "Games" (
"id" BIGSERIAL NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL UNIQUE
);

View File

@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS "Seasons" (
"id" BIGSERIAL NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"formatId" BIGSERIAL NOT NULL,
"startDate" TIMESTAMP NOT NULL,
"endDate" TIMESTAMP NOT NULL
);

View File

@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS "TeamUsersSeasons" (
"teamId" BIGSERIAL NOT NULL,
"userId" BIGSERIAL NOT NULL,
"seasonId" BIGSERIAL NOT NULL,
"registered" TIMESTAMP NOT NULL,
PRIMARY KEY("teamId", "userId", "seasonId")
);

View File

@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS "Teams" (
"id" BIGSERIAL NOT NULL PRIMARY KEY,
"name" varchar(32) NOT NULL UNIQUE,
"motto" text NULL,
"image" text NULL,
"registered" TIMESTAMP NOT NULL
);

View File

@ -0,0 +1,6 @@
CREATE TABLE IF NOT EXISTS "Users" (
"id" BIGSERIAL NOT NULL PRIMARY KEY,
"discordId" text NULL UNIQUE,
"steamId" text NULL UNIQUE,
"email" text NULL UNIQUE
);