mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Feat/um 197 hook up teams (#1825)
* Link up teams UI. * Fix auth order. * PR touchups.
This commit is contained in:
parent
f908476e71
commit
8a9532f213
17 changed files with 500 additions and 111 deletions
19
db/postgresql/migrations/07_remove_user_id/migration.sql
Normal file
19
db/postgresql/migrations/07_remove_user_id/migration.sql
Normal 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;
|
||||
|
|
@ -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,13 @@ 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])
|
||||
|
||||
@@index([teamId])
|
||||
@@index([userId])
|
||||
@@index([websiteId])
|
||||
@@map("team_website")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue