-
Notifications
You must be signed in to change notification settings - Fork 4
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
22 changed files
with
5,725 additions
and
1,017 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,11 @@ | ||
ALTER TABLE "team" DROP CONSTRAINT "team_userId_user_id_fk"; | ||
--> statement-breakpoint | ||
ALTER TABLE "team" ALTER COLUMN "userId" DROP NOT NULL;--> statement-breakpoint | ||
ALTER TABLE "matches" ADD COLUMN "comment" text;--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "team" ADD CONSTRAINT "team_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE set null ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
ALTER TABLE "league" DROP COLUMN IF EXISTS "maxScorePerMatch"; |
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,20 @@ | ||
CREATE TABLE IF NOT EXISTS "achievement" ( | ||
"id" text PRIMARY KEY NOT NULL, | ||
"createdAt" timestamp DEFAULT now() NOT NULL, | ||
"teamId" text NOT NULL, | ||
"matchId" text NOT NULL, | ||
"achievement" text NOT NULL, | ||
CONSTRAINT "achievement_achievement_teamId_unique" UNIQUE("achievement","teamId") | ||
); | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "achievement" ADD CONSTRAINT "achievement_teamId_team_id_fk" FOREIGN KEY ("teamId") REFERENCES "team"("id") ON DELETE cascade ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "achievement" ADD CONSTRAINT "achievement_matchId_matches_id_fk" FOREIGN KEY ("matchId") REFERENCES "matches"("id") ON DELETE cascade ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; |
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 @@ | ||
ALTER TABLE "team" ADD COLUMN "updatedAt" timestamp DEFAULT now() 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE "team" ADD COLUMN "totalLosses" integer DEFAULT 0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ALTER TABLE "team" ALTER COLUMN "totalHighestRating" SET DEFAULT 1000;--> statement-breakpoint | ||
ALTER TABLE "team" ALTER COLUMN "totalLowestRating" SET DEFAULT 1000;--> statement-breakpoint | ||
ALTER TABLE "league" DROP COLUMN IF EXISTS "image"; |
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
Oops, something went wrong.