-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.prisma
896 lines (767 loc) · 28.3 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
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
// Prisma schema for the LHD MySQL database
// Run `yarn` after each change
generator client {
provider = "prisma-client-js"
}
generator nexusPrisma {
provider = "nexus-prisma"
}
datasource db {
provider = "mysql"
url = env("LHD_DB_URL")
}
model aa {
id_aa Int @id @default(autoincrement())
id_lab Int
din String @db.VarChar(10)
vol Float?
description String? @db.VarChar(100)
id_unit Int
id_cosec Int
id_head Int
updated String @db.VarChar(100)
who_when String? @db.VarChar(100)
flag Boolean?
person_aa_id_cosecToperson Person @relation("aa_id_cosecToperson", fields: [id_cosec], references: [id_person])
person_aa_id_headToperson Person @relation("aa_id_headToperson", fields: [id_head], references: [id_person])
room Room @relation(fields: [id_lab], references: [id])
unit Unit @relation(fields: [id_unit], references: [id])
@@index([id_cosec], name: "id_cosec")
@@index([id_head], name: "id_head")
@@index([id_lab], name: "id_lab")
@@index([id_unit], name: "id_unit")
}
model audits {
id_audit Int @id @default(autoincrement())
id_unit Int @unique
date_audit DateTime @db.Date
@@unique([id_unit, date_audit], name: "unique_audit")
}
model auth_chem {
id_auth_chem Int @id @default(autoincrement())
cas_auth_chem String @unique @db.VarChar(100)
auth_chem_en String @unique @db.VarChar(500)
auth_chem_fr String? @db.VarChar(500)
flag_auth_chem Boolean
auth_chem_log auth_chem_log[]
auth_rchem auth_rchem[]
}
model auth_chem_log {
id_auth_chem_log Int @id @default(autoincrement())
id_auth_chem Int
sciper_author Int
author String @db.VarChar(100)
action String @db.VarChar(10)
date DateTime @db.DateTime(0)
auth_chem auth_chem @relation(fields: [id_auth_chem], references: [id_auth_chem])
@@index([id_auth_chem], name: "auth_chem_log_ibfk_1")
}
model auth_chem_old {
id_auth_chem Int @id @default(autoincrement())
cas_auth_chem String? @unique @db.VarChar(100)
auth_chem_en String? @unique @db.VarChar(100)
auth_chem_fr String? @db.VarChar(100)
}
model Dispensation {
@@map("auth_dsps")
id Int @id @default(autoincrement()) @map("id_auth_dsps")
slug String @unique @db.VarChar(10) @map("auth_dsps")
// log_in Int? -- Always NULL
// log_in_time DateTime? @db.DateTime(0) -- Only 5 data points, all before 2019
versions DispensationVersion[]
@@unique([slug, id], name: "auth_dsps_id_auth_dsps")
// @@unique([log_in, id_auth_dsps], name: "log_in_auth_dsps")
// @@unique([log_in_time, id_auth_dsps], name: "log_in_time_auth_dsps")
}
model DispensationHeldRelation {
@@map("auth_dsps_holder")
// id_auth_dsps_holder Int @id @default(autoincrement()) -- Unused
id_dispensation_version Int @map("id_auth_dsps_version")
id_person Int
dispensation_version DispensationVersion @relation(fields: [id_dispensation_version], references: [id])
person Person @relation(fields: [id_person], references: [id_person])
@@unique([id_person, id_dispensation_version], name: "authholder")
@@index([id_dispensation_version], name: "id_auth_dsps_version")
}
model DispensationInRoomRelation {
@@map("auth_dsps_lab")
// id_auth_dsps_lab Int @id @default(autoincrement()) -- Unused
id_dispensation_version Int @map("id_auth_dsps_version")
id_room Int @map("id_lab")
dispensation_version DispensationVersion @relation(fields: [id_dispensation_version], references: [id])
room Room @relation(fields: [id_room], references: [id])
@@unique([id_room, id_dispensation_version], name: "authlab")
@@index([id_dispensation_version], name: "id_auth_dsps_version")
}
model DispensationVersion {
@@map("auth_dsps_version")
id Int @id @default(autoincrement()) @map("id_auth_dsps_version")
id_dispensation Int @map("id_auth_dsps")
author String @db.VarChar(50)
sciper_author Int
subject String @db.VarChar(50)
description String? @db.VarChar(2000) @map("requires")
comment String? @db.VarChar(2000)
status String @db.VarChar(10) // One of "Active", "Canceled", "Expired" or "Pending"
date_start DateTime @db.Date
date_end DateTime @db.Date
date_created DateTime @db.DateTime(0) @map("date")
draft_status String @db.Char(5) @map("version") // Either "draft" or "final"
modified_by String? @db.VarChar(50) @map("notifier")
date_modified DateTime? @db.DateTime(0) @map("notification_date")
dispensation Dispensation @relation(fields: [id_dispensation], references: [id])
held DispensationHeldRelation[]
in_room DispensationInRoomRelation[]
@@index([id], name: "id_auth_dsps")
}
model auth_holder {
id_auth_holder Int @id @default(autoincrement())
id_auth_sst Int
sciper Int
holder_name String @db.VarChar(100)
auth_sst auth_sst @relation(fields: [id_auth_sst], references: [id_auth_sst])
@@unique([id_auth_sst, sciper, holder_name], name: "id_auth_sst_sciper_holder")
}
model auth_lab {
id_auth_lab Int @id @default(autoincrement())
id_auth_req Int
id_lab Int?
id_storage Int?
auth_req auth_req @relation(fields: [id_auth_req], references: [id_auth_req])
Room Room? @relation(fields: [id_lab], references: [id])
storage storage? @relation(fields: [id_storage], references: [id_storage])
@@index([id_auth_req], name: "id_auth_req")
@@index([id_lab], name: "id_lab")
@@index([id_storage], name: "id_storage")
}
model auth_rchem {
id_auth_rchem Int @id @default(autoincrement())
id_auth_req Int?
id_auth_chem Int?
auth_chem auth_chem? @relation(fields: [id_auth_chem], references: [id_auth_chem])
auth_req auth_req? @relation(fields: [id_auth_req], references: [id_auth_req])
@@index([id_auth_chem], name: "id_auth_chem")
@@index([id_auth_req], name: "id_auth_req")
}
model auth_req {
id_auth_req Int @id @default(autoincrement())
auth_req String? @unique @db.VarChar(16)
date_auth_req DateTime? @db.Date
auth_lab auth_lab[]
auth_rchem auth_rchem[]
auth_sst auth_sst[]
}
model auth_sst {
id_auth_sst Int @id @default(autoincrement())
id_auth_req Int
auth_sst String? @unique @db.VarChar(50)
id_unit_auth_sst Int?
date_auth_sst DateTime? @db.Date
qstock_auth_sst String? @db.VarChar(80)
quse_auth_sst String? @db.VarChar(80)
form_auth_sst String? @db.VarChar(80)
status_auth_sst String? @db.VarChar(30)
com_auth_sst String? @db.VarChar(500)
created_at DateTime? @db.Date
auth_req auth_req @relation(fields: [id_auth_req], references: [id_auth_req])
auth_holder auth_holder[]
@@index([id_auth_req], name: "id_auth_req")
}
model bio {
id_bio Int @id @default(autoincrement())
id_lab Int @unique
bio_level Int
comment String? @db.VarChar(2000)
Room Room @relation(fields: [id_lab], references: [id])
bio_org_lab bio_org_lab[]
@@index([id_lab], name: "id_lab")
}
model bio_org {
id_bio_org Int @id @default(autoincrement())
organism String @db.VarChar(100)
risk_group Int
bio_org_lab bio_org_lab[]
@@unique([organism, risk_group], name: "org_risk")
}
model bio_org_lab {
id_bio_org_lab Int @id @default(autoincrement())
id_bio Int
id_bio_org Int?
bio bio @relation(fields: [id_bio], references: [id_bio])
bio_org bio_org? @relation(fields: [id_bio_org], references: [id_bio_org])
@@unique([id_bio, id_bio_org], name: "org_lab")
@@index([id_bio_org], name: "id_bio_org")
}
model cad_corr {
id_cad_sto Int @id @default(autoincrement())
id_lab Int?
id_storage Int?
id_haz Int?
score Int?
Room Room? @relation(fields: [id_lab], references: [id])
storage storage? @relation(fields: [id_storage], references: [id_storage])
@@index([id_haz], name: "id_haz")
@@index([id_lab], name: "id_lab")
@@index([id_storage], name: "id_storage")
}
model cad_lab {
id_cad Int @id @default(autoincrement())
id_lab Int?
id_haz Int?
score Int?
haz haz? @relation(fields: [id_haz], references: [id_haz])
Room Room? @relation(fields: [id_lab], references: [id])
@@index([id_haz], name: "id_haz")
@@index([id_lab], name: "id_lab")
}
model cryo {
id_cryo Int @id @default(autoincrement())
id_dewar Int
liquid String? @db.VarChar(3)
liters Float?
dewar dewar @relation(fields: [id_dewar], references: [id_dewar])
@@index([id_dewar], name: "id_dewar")
}
model cut {
id_cut Int @id @default(autoincrement())
id_lab Int?
cut String? @db.VarChar(50)
cut_time Int?
cut_hazard String? @db.VarChar(500)
cut_measure String? @db.VarChar(500)
cut_priority Int?
Room Room? @relation(fields: [id_lab], references: [id])
@@index([id_lab], name: "id_lab")
}
model cuts {
id_cut Int @id @default(autoincrement())
building String? @db.VarChar(10)
sector String? @db.VarChar(10)
floor Int?
lab_number String? @db.VarChar(10)
type String? @db.VarChar(200)
unit String? @db.VarChar(50)
prof String? @db.VarChar(100)
cosec String? @db.VarChar(100)
cut String? @db.VarChar(50)
time String? @db.VarChar(20)
hazard String? @db.VarChar(500)
measure String? @db.VarChar(500)
priority Int?
}
model dewar {
id_dewar Int @id @default(autoincrement())
id_lab Int?
comment String? @db.VarChar(500)
Room Room? @relation(fields: [id_lab], references: [id])
cryo cryo[]
@@index([id_lab], name: "id_lab")
}
model elec {
id_elec Int @id @default(autoincrement())
id_lab Int?
capacitor String? @db.Char(1)
v_ac Float?
v_dc Float?
i Float?
i_battery Float?
state Int?
access Int?
Room Room? @relation(fields: [id_lab], references: [id])
@@index([id_lab], name: "id_lab")
}
model School {
@@map("faculty")
id Int @id @default(autoincrement()) @map("id_faculty")
name String? @unique @db.VarChar(20) @map("name_faculty")
institute Institute[]
}
model gas {
id_gas Int @id @default(autoincrement())
gas String? @db.VarChar(50)
state String? @db.VarChar(4)
gashazard gashazard[]
gnb gnb[]
}
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by the Prisma Client.
model gasbottle {
bottle Int?
building String? @db.VarChar(5)
type String? @db.VarChar(2)
cupboard String? @db.Char(1)
@@ignore
}
model gaschem {
id_gaschem Int @id @default(autoincrement())
id_lab Int?
id_storage Int?
id_haz Int
score Int?
haz haz @relation(fields: [id_haz], references: [id_haz])
Room Room? @relation(fields: [id_lab], references: [id])
storage storage? @relation(fields: [id_storage], references: [id_storage])
@@unique([id_lab, id_haz], name: "labhaz")
@@unique([id_storage, id_haz], name: "stohaz")
@@index([id_haz], name: "id_haz")
}
model gashazard {
id_gashazard Int @id @default(autoincrement())
id_gas Int?
id_hazard String? @db.VarChar(2)
gas gas? @relation(fields: [id_gas], references: [id_gas])
@@index([id_gas], name: "id_gas")
}
model gnb {
id_gnb Int @id @default(autoincrement())
id_gas Int?
gnb_q Float?
gnb_p Int?
gas gas? @relation(fields: [id_gas], references: [id_gas])
gnb_labsto gnb_labsto[]
@@index([id_gas], name: "id_gas")
}
model gnb_labsto {
id_gnbls Int @id @default(autoincrement())
id_gnb Int?
id_storage Int?
id_lab Int?
gnb gnb? @relation(fields: [id_gnb], references: [id_gnb])
Room Room? @relation(fields: [id_lab], references: [id])
storage storage? @relation(fields: [id_storage], references: [id_storage])
@@index([id_gnb], name: "id_gnb")
@@index([id_lab], name: "id_lab")
@@index([id_storage], name: "id_storage")
}
model haz {
id_haz Int @id @default(autoincrement())
haz_category String? @db.VarChar(60)
haz_en String? @db.VarChar(80)
haz_fr String? @db.VarChar(80)
id_haz_category Int
cad_lab cad_lab[]
gaschem gaschem[]
haz_date haz_date[]
}
model haz_category {
id_haz_category Int @id @default(autoincrement())
haz_category String @unique @db.VarChar(60)
haz_date haz_date[]
}
model haz_date {
id_haz_date Int @id @default(autoincrement())
id_lab Int
id_haz_category Int
id_haz Int?
date DateTime @db.DateTime(0)
editor String @db.VarChar(50)
log_in Int?
log_in_time DateTime? @db.DateTime(0)
haz haz? @relation(fields: [id_haz], references: [id_haz])
haz_category haz_category @relation(fields: [id_haz_category], references: [id_haz_category])
Room Room @relation(fields: [id_lab], references: [id])
@@index([id_haz], name: "id_haz")
@@index([id_haz_category], name: "id_haz_category")
@@index([id_lab], name: "id_lab")
}
model Institute {
@@map("institut")
id Int @id @default(autoincrement()) @map("id_institut")
name String? @db.VarChar(60) @map("name_institut")
id_school Int @map("id_faculty")
school School @relation(fields: [id_school], references: [id])
unit Unit[]
@@unique([name, id_school], name: "unique_institut")
@@index([id_school], name: "id_faculty")
}
model irad {
id_irad Int @id @default(autoincrement())
id_lab Int?
irad_facility String? @db.VarChar(50)
irad_source String? @db.VarChar(20)
irad_radioisotope String? @db.VarChar(10)
irad_activity Float?
irad_voltage Float?
irad_current Float?
irad_power Float?
irad_protection String? @db.VarChar(20)
irad_name_instrument String? @db.VarChar(50)
irad_authority String? @db.VarChar(10)
id_person Int?
irad_n_authorisation String? @db.VarChar(20)
irad_state_authorisation String? @db.VarChar(20)
irad_exdate_authorisation DateTime? @db.Date
irad_comment String? @db.VarChar(200)
Room Room? @relation(fields: [id_lab], references: [id])
person Person? @relation(fields: [id_person], references: [id_person])
@@index([id_lab], name: "id_lab")
@@index([id_person], name: "id_person")
}
model irad_resp {
id_irad_resp Int @id @default(autoincrement())
id_person Int?
irad_resp_training String? @db.VarChar(30)
irad_resp_training_place String? @db.VarChar(10)
irad_resp_training_year Int? @db.Year
person Person? @relation(fields: [id_person], references: [id_person])
@@index([id_person], name: "id_person")
}
model Room {
@@map("lab")
id Int @id @default(autoincrement()) @map("id_lab")
name String? @db.VarChar(20) @map("lab_display")
sciper_lab Int? @unique
building String @db.VarChar(5)
sector String? @db.VarChar(5)
floor String? @db.VarChar(5)
roomNo String @db.VarChar(10) @map("lab")
id_labType Int?
description String? @db.VarChar(200)
location String? @db.VarChar(10)
vol Float?
vent String? @db.Char(1)
kind RoomKind? @relation(fields: [id_labType], references: [id_labType])
aa aa[]
dispensations DispensationInRoomRelation[]
auth_lab auth_lab[]
bio bio?
cad_corr cad_corr[]
cad_lab cad_lab[]
cut cut[]
dewar dewar[]
elec elec[]
gaschem gaschem[]
gnb_labsto gnb_labsto[]
haz_date haz_date[]
irad irad[]
labunpe labunpe[]
laser laser[]
mag mag[]
mag_f mag_f[]
nano nano[]
naudits naudits[]
nirad nirad[]
noise noise?
stolabunpe stolabunpe[]
tdegree tdegree[]
unit_has_room unit_has_room[]
@@unique([building, sector, floor, roomNo], name: "unique_lab")
@@unique([sciper_lab, building, sector, floor, roomNo], name: "unique_labo")
@@index([id_labType], name: "id_labType")
}
model RoomKind {
@@map("labType")
id_labType Int @id @default(autoincrement())
name String? @db.VarChar(100) @map("labType")
Room Room[]
}
model labunpe {
id_labunpe Int @id @default(autoincrement())
id_lab Int?
id_unit Int?
id_person Int?
room Room? @relation(fields: [id_lab], references: [id])
cosec Person? @relation(fields: [id_person], references: [id_person])
unit Unit? @relation(fields: [id_unit], references: [id])
@@unique([id_lab, id_unit, id_person], name: "unique_labunpe")
@@index([id_lab], name: "id_lab")
@@index([id_person], name: "id_person")
@@index([id_unit], name: "id_unit")
}
model unit_has_room {
@@map("unit_has_room")
id_lab Int
id_unit Int
room Room @relation(fields: [id_lab], references: [id])
unit Unit @relation(fields: [id_unit], references: [id])
@@unique([id_lab, id_unit], name: "unique_unit_has_room")
@@index([id_lab], name: "id_lab")
@@index([id_unit], name: "id_unit")
}
model unit_has_cosec {
@@map("unit_has_cosec")
id_person Int
id_unit Int
cosec Person @relation(fields: [id_person], references: [id_person])
unit Unit @relation(fields: [id_unit], references: [id])
@@unique([id_person, id_unit], name: "unique_unit_has_person")
@@index([id_person], name: "id_person")
@@index([id_unit], name: "id_unit")
}
model laser {
id_laser Int @id @default(autoincrement())
id_lab Int?
laser_class String? @db.Char(2)
laser_mode String? @db.VarChar(20)
laser_wave Float?
laser_power Float?
laser_energy Float?
laser_pulse Float?
laser_frequency Float?
comment String? @db.VarChar(300)
Room Room? @relation(fields: [id_lab], references: [id])
@@index([id_lab], name: "id_lab")
}
model log_manif {
id_log_manif Int @id @default(autoincrement())
id_nature Int
id_author Int
id_editor Int
id_shared Int?
title String @db.VarChar(100)
place String @db.VarChar(100)
description String @db.VarChar(1000)
date_event DateTime @db.DateTime(0)
date_created DateTime @db.DateTime(0)
date_edited DateTime @db.DateTime(0)
@@index([id_author], name: "id_author")
@@index([id_editor], name: "id_editor")
@@index([id_nature], name: "id_nature")
@@index([id_shared], name: "id_shared")
}
model log_manif_entity {
id_entity Int @id @default(autoincrement())
entity String @db.VarChar(20)
file_entity String? @db.VarChar(50)
@@unique([entity, file_entity], name: "unique_entity")
}
model log_manif_nature {
id_nature Int @id @default(autoincrement())
nature String @unique @db.VarChar(20)
file_nature String? @db.VarChar(50)
}
model log_manif_user {
id_user Int @id @default(autoincrement())
name_user String @unique @db.VarChar(100)
user_role String @db.VarChar(10)
id_entity Int
ip_address String? @db.VarChar(16)
@@unique([name_user, user_role, id_entity], name: "unique_user_role_entity")
@@index([id_entity], name: "id_entity")
}
model mag {
id_mag Int @id @default(autoincrement())
id_lab Int?
id_person Int?
bmax Float?
mag_comment String? @db.VarChar(500)
Room Room? @relation(fields: [id_lab], references: [id])
person Person? @relation(fields: [id_person], references: [id_person])
mag_f mag_f[]
@@index([id_lab], name: "id_lab")
@@index([id_person], name: "id_person")
}
model mag_f {
id_magf Int @id @default(autoincrement())
id_mag Int
id_lab Int
line Float
line_place String? @db.Char(1)
Room Room @relation(fields: [id_lab], references: [id])
mag mag @relation(fields: [id_mag], references: [id_mag])
@@unique([id_mag, id_lab, line], name: "magf_unique")
@@index([id_lab], name: "id_lab")
@@index([id_mag], name: "id_mag")
}
model migrations {
id Int @id @default(autoincrement())
name String @db.VarChar(96)
created_at DateTime @default(now()) @db.Timestamp(0)
}
model nano {
id_nano Int @id @default(autoincrement())
id_lab Int?
nano_class String? @db.VarChar(2)
nano_type String? @db.VarChar(100)
nano_state String? @db.VarChar(20)
nano_quantity Float?
nano_activity String? @db.VarChar(500)
Room Room? @relation(fields: [id_lab], references: [id])
@@index([id_lab], name: "id_lab")
}
model naudits {
id_naudits Int @id @default(autoincrement())
id_lab Int?
score1 Float?
score2 Float?
score3 Float?
score4 Float?
score5 Float?
score6 Float?
score7 Float?
score8 Float?
naudits Float?
Room Room? @relation(fields: [id_lab], references: [id])
@@index([id_lab], name: "id_lab")
}
model nirad {
id_nirad Int @id @default(autoincrement())
id_lab Int?
nirad_type String? @db.Char(2)
source String? @db.Char(1)
freq Float?
e_field Float?
h_field Float?
b_field Float?
power Float?
Room Room? @relation(fields: [id_lab], references: [id])
@@index([id_lab], name: "id_lab")
}
model noise {
id_noise Int @id @default(autoincrement())
id_lab Int? @unique
lex Float?
lpeak Float?
Room Room? @relation(fields: [id_lab], references: [id])
@@index([id_lab], name: "id_lab")
}
model Person {
@@map("person")
id_person Int @id @default(autoincrement())
sciper Int? @unique
name String? @db.VarChar(60) @map("name_person")
surname String? @db.VarChar(60) @map("surname_person")
email String? @db.VarChar(60) @map("email_person")
aa_aa_id_cosecToperson aa[] @relation("aa_id_cosecToperson")
aa_aa_id_headToperson aa[] @relation("aa_id_headToperson")
dispensations_held DispensationHeldRelation[]
irad irad[]
irad_resp irad_resp[]
labunpe labunpe[]
mag mag[]
stolabunpe stolabunpe[]
subunpro subunpro[]
unit_has_cosec unit_has_cosec[]
@@unique([name, surname, email], name: "unique_per")
@@unique([sciper, name, surname, email], name: "unique_person")
}
model personType {
id_personType Int @id @default(autoincrement())
personType String? @db.VarChar(50)
}
model stoPlace {
id_place Int @id @default(autoincrement())
place String? @db.VarChar(30)
storage storage[]
}
model stoPlace_catalyse {
id_stoPlace Int @id @default(autoincrement())
stoPlace String @db.VarChar(30)
}
model stoProperty {
id_stoProperty Int @id @default(autoincrement())
stoProperty String? @db.VarChar(50)
storage storage[]
}
model stoProperty_catalyse {
id_stoProperty Int @id @default(autoincrement())
stoProperty String @db.VarChar(50)
}
model stoType {
id_stoType Int @id @default(autoincrement())
stoType String? @db.VarChar(20)
storage storage[]
}
model stoType_catalyse {
id_stoType Int @id @default(autoincrement())
stoType String @db.VarChar(20)
}
model stolabunpe {
id_stolabunpe Int @id @default(autoincrement())
id_storage Int?
id_lab Int?
id_unit Int?
id_person Int?
Room Room? @relation(fields: [id_lab], references: [id])
person Person? @relation(fields: [id_person], references: [id_person])
storage storage? @relation(fields: [id_storage], references: [id_storage])
unit Unit? @relation(fields: [id_unit], references: [id])
@@unique([id_storage, id_lab, id_unit, id_person], name: "unique_stolabunpe")
@@index([id_lab], name: "id_lab")
@@index([id_person], name: "id_person")
@@index([id_storage], name: "id_storage")
@@index([id_unit], name: "id_unit")
}
model storage {
id_storage Int @id @default(autoincrement())
id_stoType Int?
id_stoProperty Int?
barcode String? @db.VarChar(80)
id_place Int?
content String? @db.Char(2)
stoPlace stoPlace? @relation(fields: [id_place], references: [id_place])
stoProperty stoProperty? @relation(fields: [id_stoProperty], references: [id_stoProperty])
stoType stoType? @relation(fields: [id_stoType], references: [id_stoType])
auth_lab auth_lab[]
cad_corr cad_corr[]
gaschem gaschem[]
gnb_labsto gnb_labsto[]
stolabunpe stolabunpe[]
@@index([id_place], name: "id_place")
@@index([id_stoProperty], name: "id_stoProperty")
@@index([id_stoType], name: "id_stoType")
}
model storage_catalyse {
id_storage Int @id @default(autoincrement())
id_stoType Int
id_stoProperty Int
id_stoPlace Int
content String @db.Char(2)
barcode String @unique @db.VarChar(80)
lab_display String @db.VarChar(20)
sciper Int
author String @db.VarChar(50)
date DateTime @db.DateTime(0)
@@unique([barcode, lab_display], name: "unique_barcode")
@@index([id_stoPlace], name: "id_stoPlace")
@@index([id_stoProperty], name: "id_stoProperty")
@@index([id_stoType], name: "id_stoType")
}
model sub_storage_catalyse {
id_sub_storage Int @id @default(autoincrement())
id_storage Int
sub_storage_barcode String @unique @db.VarChar(80)
@@unique([id_storage, sub_storage_barcode], name: "unique_sub_storage_barcode")
}
model subunpro {
id_subunpro Int @id @default(autoincrement())
id_unit Int?
id_person Int?
id_subject String? @db.Char(2)
person Person? @relation(fields: [id_person], references: [id_person])
unit Unit? @relation(fields: [id_unit], references: [id])
@@unique([id_unit, id_person], name: "unique_subunpro")
@@index([id_person], name: "id_person")
@@index([id_unit], name: "id_unit")
}
model tdegree {
id_tdegree Int @id @default(autoincrement())
id_lab Int?
tdegree Float?
tdegree_type String? @db.Char(2)
tdegree_place String? @db.Char(1)
Room Room? @relation(fields: [id_lab], references: [id])
@@index([id_lab], name: "id_lab")
}
model Unit {
@@map("unit")
id Int @id @default(autoincrement()) @map("id_unit")
unitId Int? @unique @map("sciper_unit")
name String? @db.VarChar(60) @map("name_unit")
id_institute Int? @map("id_institut")
institute Institute? @relation(fields: [id_institute], references: [id])
aa aa[]
labunpe labunpe[]
stolabunpe stolabunpe[]
subunpro subunpro[]
unit_has_cosec unit_has_cosec[]
unit_has_room unit_has_room[]
@@unique([name, id_institute], name: "unique_un")
@@unique([unitId, name, id], name: "unique_unit")
@@index([id], name: "id_institut")
}
model user_catalyse {
id_user Int @id @default(autoincrement())
sciper Int @unique
role String @db.VarChar(15)
@@unique([sciper, role], name: "unique_role")
}