Link up teams UI.

This commit is contained in:
Brian Cao 2023-03-08 22:48:20 -08:00
parent bb2cd93ad4
commit aa9ad5594c
18 changed files with 504 additions and 114 deletions

View file

@ -0,0 +1,19 @@
/*
Warnings:
- You are about to drop the column `user_id` on the `team` table. All the data in the column will be lost.
- You are about to drop the column `user_id` on the `team_website` table. All the data in the column will be lost.
*/
-- DropIndex
DROP INDEX "team_user_id_idx";
-- DropIndex
DROP INDEX "team_website_user_id_idx";
-- AlterTable
ALTER TABLE "team" DROP COLUMN "user_id";
-- AlterTable
ALTER TABLE "team_website" DROP COLUMN "user_id",
ADD COLUMN "userId" UUID;

View file

@ -17,9 +17,8 @@ model User {
updatedAt DateTime? @map("updated_at") @db.Timestamptz(6)
deletedAt DateTime? @map("deleted_at") @db.Timestamptz(6)
Website Website[]
teamUser TeamUser[]
teamWebsite TeamWebsite[]
Website Website[]
teamUser TeamUser[]
@@map("user")
}
@ -86,7 +85,6 @@ model WebsiteEvent {
model Team {
id String @id() @unique() @map("team_id") @db.Uuid
name String @db.VarChar(50)
userId String @map("user_id") @db.Uuid
accessCode String? @unique @map("access_code") @db.VarChar(50)
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)
updatedAt DateTime? @map("updated_at") @db.Timestamptz(6)
@ -94,7 +92,6 @@ model Team {
teamUser TeamUser[]
teamWebsite TeamWebsite[]
@@index([userId])
@@index([accessCode])
@@map("team")
}
@ -118,16 +115,14 @@ model TeamUser {
model TeamWebsite {
id String @id() @unique() @map("team_website_id") @db.Uuid
teamId String @map("team_id") @db.Uuid
userId String @map("user_id") @db.Uuid
websiteId String @map("website_id") @db.Uuid
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)
team Team @relation(fields: [teamId], references: [id])
user User @relation(fields: [userId], references: [id])
website Website @relation(fields: [websiteId], references: [id])
userId String? @db.Uuid
@@index([teamId])
@@index([userId])
@@index([websiteId])
@@map("team_website")
}