-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.prisma
700 lines (587 loc) · 26.5 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
generator client {
provider = "prisma-client-js"
output = "../../../node_modules/.prisma/client"
previewFeatures = ["views"]
binaryTargets = ["native", "debian-openssl-3.0.x"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
}
model Asset {
assetId Int @id @default(autoincrement()) @map("asset_id")
titlePublic String @map("title_public")
titleOriginal String? @map("title_original")
isNatRel Boolean @map("is_nat_rel")
receiptDate DateTime @map("receipt_date")
municipality String? @map("municipality")
url String? @map("url")
locationAnalog String? @map("location_analog")
processor String? @map("processor")
lastProcessedDate DateTime @map("last_processed_date")
textBody String? @map("text_body")
sgsId Int? @map("sgs_id")
geolDataInfo String? @map("geol_data_info")
geolContactDataInfo String? @map("geol_contact_data_info")
geolAuxDataInfo String? @map("geol_aux_data_info")
remark String? @map("remark")
assetKindItemCode String @map("asset_kind_item_code")
assetKindItem AssetKindItem @relation(fields: [assetKindItemCode], references: [assetKindItemCode])
createDate DateTime @map("create_date")
assetFormatItemCode String @map("asset_format_item_code")
assetFormatItem AssetFormatItem @relation(fields: [assetFormatItemCode], references: [assetFormatItemCode])
authorBiblio String? @map("author_biblio_id")
sourceProject String? @map("source_project")
description String? @map("description")
isExtract Boolean @map("is_extract")
internalUseId Int @map("internal_use_id")
internalUse InternalUse @relation(fields: [internalUseId], references: [internalUseId])
publicUseId Int @map("public_use_id")
publicUse PublicUse @relation(fields: [publicUseId], references: [publicUseId])
assetMainId Int? @map("asset_main_id")
assetMain Asset? @relation(name: "asset", fields: [assetMainId], references: [assetId])
assetContacts AssetContact[]
assetFiles AssetFile[]
assetFormatCompositions AssetFormatComposition[]
assetKindCompositions AssetKindComposition[]
assetPublications AssetPublication[]
assetLanguages AssetLanguage[]
autoCats AutoCat[]
ids Id[]
manCatLabelRefs ManCatLabelRef[]
statusWorks StatusWork[]
studyAreas StudyArea[]
studyLocations StudyLocation[]
studyTraces StudyTrace[]
typeNatRels TypeNatRel[]
workgroup Workgroup @relation(fields: [workgroupId], references: [id])
workgroupId Int @map("workgroup_id")
siblingXAssets AssetXAssetY[] @relation("sibling_x_asset")
siblingYAssets AssetXAssetY[] @relation("sibling_y_asset")
assetInternalProjects AssetInternalProject[]
subordinateAssets Asset[] @relation("asset")
favorites Favorite[]
allStudies AllStudy[]
@@map("asset")
}
model Id {
idId Int @id @default(autoincrement()) @map("id_id")
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
id String @map("id")
description String @map("description")
@@map("id")
}
model AssetXAssetY {
assetXId Int @map("asset_x_id")
assetX Asset @relation("sibling_x_asset", fields: [assetXId], references: [assetId], onDelete: Cascade)
assetYId Int @map("asset_y_id")
assetY Asset @relation("sibling_y_asset", fields: [assetYId], references: [assetId], onDelete: Cascade)
@@id([assetXId, assetYId])
@@map("asset_x_asset_y")
}
model InternalUse {
internalUseId Int @id @default(autoincrement()) @map("internal_use_id")
isAvailable Boolean @map("is_available")
statusAssetUseItemCode String @map("status_asset_use_item_code")
statusAssetUseItem StatusAssetUseItem @relation(fields: [statusAssetUseItemCode], references: [statusAssetUseItemCode])
startAvailabilityDate DateTime? @map("start_availability_date")
Asset Asset[]
@@map("internal_use")
}
model PublicUse {
publicUseId Int @id @default(autoincrement()) @map("public_use_id")
isAvailable Boolean @map("is_available")
statusAssetUseItemCode String @map("status_asset_use_item_code")
statusAssetUseItem StatusAssetUseItem @relation(fields: [statusAssetUseItemCode], references: [statusAssetUseItemCode])
startAvailabilityDate DateTime? @map("start_availability_date")
Asset Asset[]
@@map("public_use")
}
model AssetFile {
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
fileId Int @map("file_id")
file File @relation(fields: [fileId], references: [id], onDelete: Cascade)
@@id([assetId, fileId])
@@map("asset_file")
}
enum OcrState {
willNotBeProcessed
created
waiting
processing
error
success
}
enum FileType {
Normal @map("normal")
Legal @map("legal")
}
model File {
id Int @id @default(autoincrement()) @map("id")
name String @map("name")
ocrStatus OcrState @default(created) @map("ocr_status")
size BigInt @map("size")
lastModifiedAt DateTime @map("last_modified_at")
type FileType @default(Normal) @map("type")
legalDocItemCode String? @map("legal_doc_item_code")
legalDocItem LegalDocItem? @relation(fields: [legalDocItemCode], references: [legalDocItemCode])
AssetObjectInfo AssetObjectInfo[]
AssetFile AssetFile[]
@@unique([name])
@@index([type])
@@map("file")
}
model AssetObjectInfo {
assetObjectInfoId Int @id @default(autoincrement()) @map("asset_object_info_id")
fileId Int @map("file_id")
file File @relation(fields: [fileId], references: [id])
autoObjectCatItemCode String @map("auto_object_cat_item_code")
autoObjectCatItem AutoObjectCatItem @relation(fields: [autoObjectCatItemCode], references: [autoObjectCatItemCode])
objectPage String @map("object_page")
objectBbox String @map("object_bbox")
objectScore String @map("object_score")
pathToImage String @map("path_to_image")
@@map("asset_object_info")
}
model ManCatLabelRef {
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
manCatLabelItemCode String @map("man_cat_label_item_code")
manCatLabelItem ManCatLabelItem @relation(fields: [manCatLabelItemCode], references: [manCatLabelItemCode])
@@unique([assetId, manCatLabelItemCode])
@@map("man_cat_label_ref")
}
model AssetFormatComposition {
assetFormatCompositionId Int @id @default(autoincrement()) @map("asset_format_composition_id")
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
assetFormatItemCode String @map("asset_format_item_code")
assetFormatItem AssetFormatItem @relation(fields: [assetFormatItemCode], references: [assetFormatItemCode])
@@map("asset_format_composition")
}
model AssetKindComposition {
assetKindCompositionId Int @id @default(autoincrement()) @map("asset_kind_composition_id")
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
assetKindItemCode String @map("asset_kind_item_code")
assetKindItem AssetKindItem @relation(fields: [assetKindItemCode], references: [assetKindItemCode])
@@map("asset_kind_composition")
}
model StatusWork {
statusWorkId Int @id @default(autoincrement()) @map("status_work_id")
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
statusWorkItemCode String @map("status_work_item_code")
statusWorkItem StatusWorkItem @relation(fields: [statusWorkItemCode], references: [statusWorkItemCode])
statusWorkDate DateTime @map("status_work_date")
processor String? @map("processor")
@@map("status_work")
}
model AutoCat {
autoCatId Int @id @default(autoincrement()) @map("auto_cat_id")
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
autoCatLabelItemCode String @map("auto_cat_label_item_code")
autoCatLabelItem AutoCatLabelItem @relation(fields: [autoCatLabelItemCode], references: [autoCatLabelItemCode])
autoCatLabelScore Int @map("auto_cat_label_score")
@@map("auto_cat")
}
model TypeNatRel {
typeNatRelId Int @id @default(autoincrement()) @map("type_nat_rel_id")
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
natRelItemCode String @map("nat_rel_item_code")
natRelItem NatRelItem @relation(fields: [natRelItemCode], references: [natRelItemCode])
@@map("type_nat_rel")
}
model Contact {
contactId Int @id @default(autoincrement()) @map("contact_id")
contactKindItemCode String @map("contact_kind_item_code")
contactKindItem ContactKindItem @relation(fields: [contactKindItemCode], references: [contactKindItemCode])
name String @map("name")
street String? @map("street")
houseNumber String? @map("house_number")
plz String? @map("plz")
locality String? @map("locality")
country String? @map("country")
telephone String? @map("telephone")
email String? @map("email")
website String? @map("website")
assetContacts AssetContact[]
@@map("contact")
}
model AssetContact {
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
contactId Int @map("contact_id")
contact Contact @relation(fields: [contactId], references: [contactId])
role String @map("role")
@@id([assetId, contactId, role])
@@map("asset_contact")
}
model Publication {
publicationId Int @id @default(autoincrement()) @map("publication_id")
pubChannelItemCode String @map("pub_channel_item_code")
pubChannelItem PubChannelItem @relation(fields: [pubChannelItemCode], references: [pubChannelItemCode])
publicationDate DateTime @map("publication_date")
description String @map("description")
link String @map("link")
assetPublications AssetPublication[]
@@map("publication")
}
model AssetPublication {
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
publicationId Int @map("publication_id")
publication Publication @relation(fields: [publicationId], references: [publicationId])
@@id([assetId, publicationId])
@@map("asset_publication")
}
model InternalProject {
internalProjectId Int @id @default(autoincrement()) @map("internal_project_id")
name String @map("name")
description String? @map("description")
dateDelivered String @map("date_delivered")
assetInternalProjects AssetInternalProject[]
@@map("internal_project")
}
model AssetInternalProject {
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
internalProjectId Int @map("internal_project_id")
internalProject InternalProject @relation(fields: [internalProjectId], references: [internalProjectId])
@@id([assetId, internalProjectId])
@@map("asset_internal_project")
}
model StudyArea {
studyAreaId Int @id @default(autoincrement()) @map("study_area_id")
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
geomQualityItemCode String @map("geom_quality_item_code")
geomQualityItem GeomQualityItem @relation(fields: [geomQualityItemCode], references: [geomQualityItemCode])
geom Unsupported("geometry")?
@@index([geom], type: Gist)
@@map("study_area")
}
model StudyLocation {
studyLocationId Int @id @default(autoincrement()) @map("study_location_id")
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
geomQualityItemCode String @map("geom_quality_item_code")
geomQualityItem GeomQualityItem @relation(fields: [geomQualityItemCode], references: [geomQualityItemCode])
geom Unsupported("geometry")?
@@index([geom], type: Gist)
@@map("study_location")
}
model StudyTrace {
studyTraceId Int @id @default(autoincrement()) @map("study_trace_id")
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
geomQualityItemCode String @map("geom_quality_item_code")
geomQualityItem GeomQualityItem @relation(fields: [geomQualityItemCode], references: [geomQualityItemCode])
geom Unsupported("geometry")?
@@index([geom], type: Gist)
@@map("study_trace")
}
model AssetFormatItem {
assetFormatItemCode String @id @map("asset_format_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
assets Asset[]
assetFormatCompositions AssetFormatComposition[]
@@map("asset_format_item")
}
model AssetKindItem {
assetKindItemCode String @id @map("asset_kind_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
assets Asset[]
assetKindCompositions AssetKindComposition[]
@@map("asset_kind_item")
}
model AutoCatLabelItem {
autoCatLabelItemCode String @id @map("asset_cat_label_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
autoCats AutoCat[]
@@map("auto_cat_label_item")
}
model AutoObjectCatItem {
autoObjectCatItemCode String @id @map("auto_object_cat_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
assetObjectInfos AssetObjectInfo[]
@@map("auto_object_cat_item")
}
model ContactKindItem {
contactKindItemCode String @id @map("contact_kind_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
contacts Contact[]
@@map("contact_kind_item")
}
model GeomQualityItem {
geomQualityItemCode String @id @map("geom_quality_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
studyAreas StudyArea[]
studyLocations StudyLocation[]
studyTraces StudyTrace[]
@@map("geom_quality_item")
}
model LanguageItem {
languageItemCode String @id @map("language_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
assets AssetLanguage[]
@@map("language_item")
}
model AssetLanguage {
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
languageItemCode String @map("language_item_code")
languageItem LanguageItem @relation(fields: [languageItemCode], references: [languageItemCode])
@@id([assetId, languageItemCode])
@@map("asset_language")
}
model ManCatLabelItem {
manCatLabelItemCode String @id @map("man_cat_label_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
manCatLabelRefs ManCatLabelRef[]
@@map("man_cat_label_item")
}
model NatRelItem {
natRelItemCode String @id @map("nat_rel_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
typeNatRels TypeNatRel[]
@@map("nat_rel_item")
}
model LegalDocItem {
legalDocItemCode String @id @map("legal_doc_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
File File[]
@@map("legal_doc_item")
}
model PubChannelItem {
pubChannelItemCode String @id @map("pub_channel_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
publications Publication[]
@@map("pub_channel_item")
}
model StatusAssetUseItem {
statusAssetUseItemCode String @id @map("status_asset_use_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
publicUses PublicUse[]
internalUses InternalUse[]
@@map("status_asset_use_item")
}
model StatusWorkItem {
statusWorkItemCode String @id @map("status_work_item_code")
geolCode String @map("geol_code")
name String @map("name")
nameDe String @map("name_de")
nameFr String @map("name_fr")
nameRm String @map("name_rm")
nameIt String @map("name_it")
nameEn String @map("name_en")
description String @map("description")
descriptionDe String @map("description_de")
descriptionFr String @map("description_fr")
descriptionRm String @map("description_rm")
descriptionIt String @map("description_it")
descriptionEn String @map("description_en")
statusWorks StatusWork[]
@@map("status_work_item")
}
model AssetUser {
id String @id @db.Uuid
email String
lang String
oidcId String
favorites Favorite[]
workgroups WorkgroupsOnUsers[]
isAdmin Boolean @default(false) @map("is_admin")
@@map("asset_user")
}
model Workgroup {
id Int @id @default(autoincrement())
name String @unique
created_at DateTime @db.Timestamptz(6)
disabled_at DateTime? @db.Timestamptz(6)
users WorkgroupsOnUsers[]
assets Asset[]
@@map("workgroup")
}
model WorkgroupsOnUsers {
workgroup Workgroup @relation(fields: [workgroupId], references: [id])
workgroupId Int @map("workgroup_id")
user AssetUser @relation(fields: [userId], references: [id])
userId String @map("user_id") @db.Uuid
role Role
@@id([workgroupId, userId])
@@map("workgroups_on_users")
}
enum Role {
Viewer @map("viewer")
Editor @map("editor")
MasterEditor @map("master-editor")
}
model Favorite {
userId String @map("user_id") @db.Uuid
user AssetUser @relation(fields: [userId], references: [id])
assetId Int @map("asset_id")
Asset Asset @relation(fields: [assetId], references: [assetId])
@@id([userId, assetId])
@@map("favorite")
}
view AllStudy {
assetId Int @map("asset_id")
asset Asset @relation(fields: [assetId], references: [assetId], onDelete: Cascade)
id Int
studyId String @unique @map("study_id")
geom Unsupported("geometry")?
isPoint Boolean @map("is_point")
centroidGeomText String @map("centroid_geom_text")
geomText String @map("geom_text")
@@map("all_study")
}