Skip to content

Instantly share code, notes, and snippets.

@MohammedALREAI
Created September 6, 2021 23:38
Show Gist options
  • Save MohammedALREAI/4638298d9ec29625bd148421277fa35d to your computer and use it in GitHub Desktop.
Save MohammedALREAI/4638298d9ec29625bd148421277fa35d to your computer and use it in GitHub Desktop.
house prisma
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource db {
provider = "postgresql"
url = env("PG_CONNECTIONSTRING")
}
generator client {
provider = "prisma-client-js"
}
model House {
id String @id @default(cuid())
images String
latitude Float
longitude Float
address String
bedrooms Int
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
reviewHouses Review[]
}
enum StatusOrderHouse {
Active
Deleted
Inactive
}
model Order {
id String @id @default(cuid())
welletUser String
status StatusOrderHouse
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
}
model Review {
id String @id @default(cuid())
title String
userName String
house House @relation(fields: [houseId], references: [id])
houseId String
updatedAt DateTime @default(now()) @updatedAt
createdAt DateTime @default(now())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment