This commit is contained in:
jackbeeby
2025-04-14 12:17:06 +10:00
parent 0b9d543d36
commit c30cc6a377

View File

@@ -13,32 +13,44 @@ datasource db {
url = env("DATABASE_URL") url = env("DATABASE_URL")
} }
/*
Some tips:
? means can be null or optional
[] means 1 to many
*/
model Account { model Account {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
type String? type String?
firstName String? firstName String?
lastName String? lastName String?
email String? @unique email String?
phone Int? phone Int?
company String? company String?
password String? password String?
accountInformation AccountInformation? accountInformation AccountInformation?
BusinessInformation BusinessInformation?
JobPost JobPost[]
} }
model JobPost { model JobPost {
id BigInt @id @default(autoincrement()) id BigInt @id @default(autoincrement())
businessId Int? businessId Int?
heading BigInt? heading String?
description BigInt? description String?
locationText BigInt? locationText Int?
locationLongLat BigInt? locationLongLat Int?
field BigInt? jobField String?
contractType BigInt? contractType String?
payRange BigInt? payRange String?
hours BigInt? hours String?
createdAt BigInt? createdAt DateTime @default(now())
endingAtTime BigInt? endingAtTime DateTime?
accountId Int
account Account @relation(fields: [accountId], references: [id])
} }
model AccountInformation { model AccountInformation {
@@ -53,3 +65,11 @@ model AccountInformation {
accountId Int @unique // Add the unique constraint here accountId Int @unique // Add the unique constraint here
account Account @relation(fields: [accountId], references: [id]) account Account @relation(fields: [accountId], references: [id])
} }
model BusinessInformation {
id Int @id @default(autoincrement())
businessName String?
abn Int?
accountId Int @unique // Add the unique constraint here
account Account @relation(fields: [accountId], references: [id])
}