-
-
Save tombowditch/45bf4e9c424cdbc24a41ad91e8226cb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
generator db { | |
provider = "go run github.com/stephenafamo/bob/gen/bobgen-prisma" | |
output = "./prisma" | |
configFile = "./bobgen.yml" | |
previewFeatures = ["extendedWhereUnique", "postgresqlExtensions", "fullTextSearch"] | |
} | |
datasource db { | |
provider = "postgresql" | |
url = env("DATABASE_URL") | |
extensions = [citext] | |
} | |
model Business { | |
id String @id @default(uuid()) | |
name String | |
description String | |
slug String @unique | |
owner User @relation(fields: [ownerId], references: [id]) | |
ownerId String | |
setup Boolean @default(false) | |
branding BusinessBranding? | |
} | |
model BusinessBranding { | |
id String @id @default(uuid()) | |
business Business @relation(fields: [businessId], references: [id]) | |
businessId String @unique | |
logo String? | |
banner String? | |
primaryColour String? | |
secondaryColour String? | |
} | |
model User { | |
id String @id @default(uuid()) | |
createdAt DateTime @default(now()) | |
updatedAt DateTime @updatedAt | |
lastLogin DateTime? | |
twoFactorSecret String? | |
businesses Business[] | |
profile UserProfile? | |
} | |
model UserProfile { | |
id String @id @default(uuid()) | |
user User @relation(fields: [userId], references: [id]) | |
userId String @unique | |
username String @unique @db.Citext | |
avatar String? | |
firstName String? | |
lastName String? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment