-
Notifications
You must be signed in to change notification settings - Fork 11
/
schema.prisma
106 lines (93 loc) · 3.37 KB
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
generator client {
provider = "prisma-client-js"
previewFeatures = ["multiSchema", "postgresqlExtensions"]
}
datasource db {
provider = "postgresql"
url = env("POSTGRES_URI")
extensions = [postgis(schema: "extensions"), uuid_ossp(map: "uuid-ossp", schema: "extensions")]
schemas = ["audit", "extensions", "public"]
}
model areas {
id String @id @db.Char(24)
geometry Unsupported("geography")?
name String? @unique
priority Int?
type String?
dataset_id Int?
version Int?
toilets toilets[]
@@schema("public")
}
model toilets {
id String @id @db.Char(24)
created_at DateTime? @db.Timestamptz(6)
contributors String[]
accessible Boolean?
active Boolean?
attended Boolean?
automatic Boolean?
baby_change Boolean?
men Boolean?
name String?
no_payment Boolean?
notes String?
payment_details String?
radar Boolean?
removal_reason String?
women Boolean?
updated_at DateTime? @db.Timestamptz(6)
geography Unsupported("geography")?
urinal_only Boolean?
all_gender Boolean?
children Boolean?
geohash String? @default(dbgenerated("st_geohash(geography)"))
verified_at DateTime? @db.Timestamptz(6)
area_id String? @db.Char(24)
opening_times Json?
location Json? @default(dbgenerated("(st_asgeojson((geography)::geometry))::jsonb"))
areas areas? @relation(fields: [area_id], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "toilets___area_id_fk")
@@schema("public")
}
model spatial_ref_sys {
srid Int @id
auth_name String? @db.VarChar(256)
auth_srid Int?
srtext String? @db.VarChar(2048)
proj4text String? @db.VarChar(2048)
@@schema("extensions")
}
/// This model contains row level security and requires additional setup for migrations. Visit https://pris.ly/d/row-level-security for more info.
model record_version {
id BigInt @id @default(autoincrement())
record_id String? @db.Uuid
old_record_id String? @db.Uuid
op operation
ts DateTime @default(now()) @db.Timestamptz(6)
table_oid Int @db.Oid
table_schema Unsupported("name")
table_name Unsupported("name")
record Json?
old_record Json?
auth_uid String? @default(dbgenerated("auth.uid()")) @db.Uuid
auth_role String? @default(dbgenerated("auth.role()"))
@@index([table_oid], map: "record_version_table_oid")
@@index([ts], map: "record_version_ts", type: Brin)
@@schema("audit")
}
/// This model contains row level security and requires additional setup for migrations. Visit https://pris.ly/d/row-level-security for more info.
model feedback {
id Int @id @default(autoincrement())
email String? @db.VarChar(255)
feedback_text String @db.VarChar(5000)
route String @db.VarChar(255)
created_at DateTime? @default(now()) @db.Timestamp(6)
@@schema("public")
}
enum operation {
INSERT
UPDATE
DELETE
TRUNCATE
@@schema("audit")
}