fleets/storage/postgresql/schema.hcl

89 lines
1.4 KiB
HCL

table "booking" {
schema = schema.fleets
column "id" {
null = false
type = uuid
}
column "vehicleid" {
null = true
type = uuid
}
column "driver" {
null = true
type = text
}
column "startdate" {
null = true
type = timestamptz
}
column "enddate" {
null = true
type = timestamptz
}
column "unavailablefrom" {
null = true
type = timestamptz
}
column "unavailableto" {
null = true
type = timestamptz
}
column "data" {
null = true
type = jsonb
}
column "deleted" {
null = true
type = boolean
}
primary_key {
columns = [column.id]
}
foreign_key "booking_vehicleid_fkey" {
columns = [column.vehicleid]
ref_columns = [table.vehicle.column.id]
on_update = NO_ACTION
on_delete = NO_ACTION
}
foreign_key "vehicle_booking_fk" {
columns = [column.vehicleid]
ref_columns = [table.vehicle.column.id]
on_update = NO_ACTION
on_delete = NO_ACTION
}
}
table "vehicle" {
schema = schema.fleets
column "id" {
null = false
type = uuid
}
column "type" {
null = true
type = text
}
column "namespace" {
null = true
type = text
}
column "administrators" {
null = true
type = sql("text[]")
}
column "data" {
null = true
type = jsonb
}
column "metadata" {
null = true
type = jsonb
}
primary_key {
columns = [column.id]
}
}
schema "fleets" {
}