diff --git a/prisma/schema.prisma b/prisma/schema.prisma index bf5d456..3459ed0 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -27,24 +27,24 @@ enum LicenseCode { } model User { - id String @id @default(uuid()) @db.Uuid - email String @unique - passwordHash String @map("password_hash") - name String? - role UserRole @default(USER) - isActive Boolean @default(true) @map("is_active") - lastLoginAt DateTime? @map("last_login_at") @db.Timestamptz(3) - profileImageData Bytes? @map("profile_image_data") - profileImageMime String? @map("profile_image_mime") - profileImageUpdatedAt DateTime? @map("profile_image_updated_at") @db.Timestamptz(3) - createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3) - updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz(3) - refreshTokens RefreshToken[] - handoffTokens HandoffToken[] - affiliations UserAffiliation[] - userLicenses UserLicense[] - appRoles UserAppRole[] - oauthAccounts UserOauthAccount[] + id String @id @default(uuid()) @db.Uuid + email String @unique + passwordHash String @map("password_hash") + name String? + role UserRole @default(USER) + isActive Boolean @default(true) @map("is_active") + lastLoginAt DateTime? @map("last_login_at") @db.Timestamptz(3) + profileImageData Bytes? @map("profile_image_data") + profileImageMime String? @map("profile_image_mime") + profileImageUpdatedAt DateTime? @map("profile_image_updated_at") @db.Timestamptz(3) + createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3) + updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz(3) + refreshTokens RefreshToken[] + handoffTokens HandoffToken[] + affiliations UserAffiliation[] + userLicenses UserLicense[] + appRoles UserAppRole[] + oauthAccounts UserOauthAccount[] @@map("users") } @@ -84,15 +84,15 @@ model UserAppRole { } model License { - id String @id @default(uuid()) @db.Uuid - code LicenseCode @unique - name String - description String? + id String @id @default(uuid()) @db.Uuid + code LicenseCode @unique + name String + description String? defaultDurationDays Int? @default(365) @map("default_duration_days") - isActive Boolean @default(true) @map("is_active") - createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3) - updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz(3) - userLicenses UserLicense[] + isActive Boolean @default(true) @map("is_active") + createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3) + updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz(3) + userLicenses UserLicense[] @@index([isActive]) @@map("licenses") @@ -174,19 +174,3 @@ model HandoffToken { @@index([userId]) @@map("handoff_tokens") } - -model LoginNotice { - id String @id @default(uuid()) @db.Uuid - title String - body String - linkUrl String? @map("link_url") - isActive Boolean @default(true) @map("is_active") - startsAt DateTime? @map("starts_at") @db.Timestamptz(3) - endsAt DateTime? @map("ends_at") @db.Timestamptz(3) - priority Int @default(0) - createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3) - updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz(3) - - @@index([isActive, priority]) - @@map("login_notices") -}