first commit

This commit is contained in:
sbriat
2023-04-06 11:12:49 +02:00
parent 8abee6afac
commit d7b1c54b45
53 changed files with 11540 additions and 87 deletions

59
prisma/schema.prisma Normal file
View File

@@ -0,0 +1,59 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
extensions = [postgis]
}
model Ad {
uuid String @id @default(uuid()) @db.Uuid
driver Boolean
passenger Boolean
frequency Int
from_date DateTime @db.Date
to_date DateTime @db.Date
mon_time DateTime @db.Timestamptz()
tue_time DateTime @db.Timestamptz()
wed_time DateTime @db.Timestamptz()
thu_time DateTime @db.Timestamptz()
fri_time DateTime @db.Timestamptz()
sat_time DateTime @db.Timestamptz()
sun_time DateTime @db.Timestamptz()
mon_margin Int
tue_margin Int
wed_margin Int
thu_margin Int
fri_margin Int
sat_margin Int
sun_margin Int
driver_duration Int
driver_distance Int
passenger_duration Int
passenger_distance Int
origin_type Int @db.SmallInt
destination_type Int @db.SmallInt
waypoints Unsupported("geography(LINESTRING)")
direction Unsupported("geography(LINESTRING)")
fwd_azimuth Int
back_azimuth Int
seats_driver Int @db.SmallInt
seats_passenger Int @db.SmallInt
seats_used Int @db.SmallInt
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
@@index([driver])
@@index([passenger])
@@index([from_date])
@@index([to_date])
@@index([fwd_azimuth])
@@index([direction], name: "direction_idx", type: Gist)
@@map("ad")
}