drop foreign keys, add missing indexes

This commit is contained in:
Francis Cao 2022-12-27 16:26:25 -08:00
parent c90bd941b5
commit 8ee7172ea0
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,17 @@
-- DropForeignKey
ALTER TABLE "team_user" DROP CONSTRAINT "team_user_team_id_fkey";
-- DropForeignKey
ALTER TABLE "team_user" DROP CONSTRAINT "team_user_user_id_fkey";
-- DropForeignKey
ALTER TABLE "website" DROP CONSTRAINT "website_team_id_fkey";
-- DropForeignKey
ALTER TABLE "website" DROP CONSTRAINT "website_user_id_fkey";
-- CreateIndex
CREATE INDEX "website_team_id_idx" ON "website"("team_id");
-- CreateIndex
CREATE INDEX "website_user_id_idx" ON "website"("user_id");

View File

@ -5,6 +5,7 @@ generator client {
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
relationMode = "prisma"
}
model User {
@ -54,6 +55,8 @@ model Website {
team Team? @relation(fields: [teamId], references: [id])
user User? @relation(fields: [userId], references: [id])
@@index([teamId])
@@index([userId])
@@index([createdAt])
@@index([shareId])
@@map("website")