mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-25 02:36:20 +01:00
Merge pull request #1719 from umami-software/feat/um-138-remove-prisma-foreign-key
Feat/um 138 remove prisma foreign key
This commit is contained in:
commit
f42cab8d83
17
db/postgresql/migrations/03_drop_foreign_keys/migration.sql
Normal file
17
db/postgresql/migrations/03_drop_foreign_keys/migration.sql
Normal 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");
|
@ -5,6 +5,7 @@ generator client {
|
|||||||
datasource db {
|
datasource db {
|
||||||
provider = "postgresql"
|
provider = "postgresql"
|
||||||
url = env("DATABASE_URL")
|
url = env("DATABASE_URL")
|
||||||
|
relationMode = "prisma"
|
||||||
}
|
}
|
||||||
|
|
||||||
model User {
|
model User {
|
||||||
@ -54,6 +55,8 @@ model Website {
|
|||||||
team Team? @relation(fields: [teamId], references: [id])
|
team Team? @relation(fields: [teamId], references: [id])
|
||||||
user User? @relation(fields: [userId], references: [id])
|
user User? @relation(fields: [userId], references: [id])
|
||||||
|
|
||||||
|
@@index([teamId])
|
||||||
|
@@index([userId])
|
||||||
@@index([createdAt])
|
@@index([createdAt])
|
||||||
@@index([shareId])
|
@@index([shareId])
|
||||||
@@map("website")
|
@@map("website")
|
||||||
|
Loading…
Reference in New Issue
Block a user