mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-08 20:26:08 -05:00
team migration unapplied
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "User" ADD COLUMN "teamId" INTEGER,
|
||||
ADD COLUMN "teamId" INTEGER;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Team" (
|
||||
"id" SERIAL,
|
||||
"name" TEXT NOT NULL,
|
||||
"nameForUrl" TEXT NOT NULL,
|
||||
"twitterName" TEXT,
|
||||
"bio" TEXT,
|
||||
"recruitingPost" TEXT,
|
||||
"inviteCode" TEXT NOT NULL,
|
||||
"captainId" INTEGER NOT NULL,
|
||||
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Team.nameForUrl_unique" ON "Team"("nameForUrl");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Team.inviteCode_unique" ON "Team"("inviteCode");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Team.captainId_unique" ON "Team"("captainId");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Team" ADD FOREIGN KEY("captainId")REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "User" ADD FOREIGN KEY("teamId")REFERENCES "Team"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
@@ -14,12 +14,15 @@ model User {
|
||||
discriminator String
|
||||
discordId String @unique
|
||||
discordAvatar String?
|
||||
teamId Int?
|
||||
profile Profile?
|
||||
player Player?
|
||||
builds Build[]
|
||||
submittedRecords SalmonRunRecord[]
|
||||
salmonRunRecords SalmonRunRecord[] @relation("SalmonRunRecordRoster")
|
||||
freeAgentPost FreeAgentPost?
|
||||
team Team? @relation("TeamRoster")
|
||||
captainedTeam Team? @relation("TeamCaptain")
|
||||
}
|
||||
|
||||
model Profile {
|
||||
@@ -231,3 +234,16 @@ model FreeAgentPost {
|
||||
likedPosts FreeAgentPost[] @relation("LikedPosts", references: [id])
|
||||
likersPosts FreeAgentPost[] @relation("LikedPosts", references: [id])
|
||||
}
|
||||
|
||||
model Team {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
nameForUrl String @unique
|
||||
twitterName String?
|
||||
bio String?
|
||||
recruitingPost String?
|
||||
inviteCode String @unique
|
||||
captainId Int @unique
|
||||
captain User @relation("TeamCaptain", fields: [captainId], references: [id])
|
||||
roster User[] @relation("TeamRoster")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user