mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-25 20:50:14 -05:00
unique id to principal migration
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `uniqueId` on the `DetailedMapPlayer` table. All the data in the column will be lost.
|
||||
- The migration will add a unique constraint covering the columns `[detailedMapId,principalId]` on the table `DetailedMapPlayer`. If there are existing duplicate values, the migration will fail.
|
||||
- Added the required column `principalId` to the `DetailedMapPlayer` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- DropIndex
|
||||
DROP INDEX "DetailedMapPlayer.detailedMapId_uniqueId_unique";
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "DetailedMapPlayer" DROP CONSTRAINT "DetailedMapPlayer_uniqueId_fkey";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "DetailedMapPlayer" DROP COLUMN "uniqueId",
|
||||
ADD COLUMN "principalId" TEXT NOT NULL;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "DetailedMapPlayer.detailedMapId_principalId_unique" ON "DetailedMapPlayer"("detailedMapId", "principalId");
|
||||
@@ -114,7 +114,6 @@ model Player {
|
||||
placements XRankPlacement[]
|
||||
user User? @relation(fields: [userId], references: [id])
|
||||
leaguePlacements LeagueSquadMember[]
|
||||
detailedMapInfos DetailedMapPlayer[]
|
||||
|
||||
@@index([principalId])
|
||||
}
|
||||
@@ -324,7 +323,7 @@ enum WinnerLoser {
|
||||
model DetailedMapPlayer {
|
||||
detailedMapId Int
|
||||
status WinnerLoser
|
||||
uniqueId String
|
||||
principalId String
|
||||
name String
|
||||
weapon String
|
||||
mainAbilities Ability[]
|
||||
@@ -335,8 +334,7 @@ model DetailedMapPlayer {
|
||||
specials Int
|
||||
paint Int
|
||||
gear String[]
|
||||
player Player @relation(fields: [uniqueId], references: [switchAccountId])
|
||||
detailedMap DetailedMap @relation(fields: [detailedMapId], references: [id])
|
||||
|
||||
@@unique([detailedMapId, uniqueId])
|
||||
@@unique([detailedMapId, principalId])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user