-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.prisma
More file actions
627 lines (580 loc) · 33.9 KB
/
schema.prisma
File metadata and controls
627 lines (580 loc) · 33.9 KB
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
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
}
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
model databasechangelog {
id String @db.VarChar(255)
author String @db.VarChar(255)
filename String @db.VarChar(255)
dateexecuted DateTime @db.Timestamp(6)
orderexecuted Int
exectype String @db.VarChar(10)
md5sum String? @db.VarChar(35)
description String? @db.VarChar(255)
comments String? @db.VarChar(255)
tag String? @db.VarChar(255)
liquibase String? @db.VarChar(20)
contexts String? @db.VarChar(255)
labels String? @db.VarChar(255)
deployment_id String? @db.VarChar(10)
@@ignore
}
model databasechangeloglock {
id Int @id
locked Boolean
lockgranted DateTime? @db.Timestamp(6)
lockedby String? @db.VarChar(255)
}
model file_uploads {
id BigInt @id @default(autoincrement())
upload_id String @unique @db.VarChar(255)
file_id String? @db.VarChar(255)
filename String? @db.VarChar(500)
original_filename String? @db.VarChar(500)
content_type String? @db.VarChar(255)
detected_content_type String? @db.VarChar(255)
content_length BigInt?
checksum_sha256 String? @db.VarChar(255)
upload_status String @db.VarChar(50)
file_status String? @db.VarChar(50)
rejection_reason String?
number_of_rejected_files Int @default(0)
s3_bucket String? @db.VarChar(255)
s3_key String? @db.VarChar(1000)
entity_type String? @db.VarChar(100)
entity_id BigInt?
reference String? @db.VarChar(255)
uploaded_by_user_id BigInt?
metadata Json?
created_at DateTime @default(now()) @db.Timestamp(6)
updated_at DateTime @default(now()) @db.Timestamp(6)
completed_at DateTime? @db.Timestamp(6)
pafs_core_users pafs_core_users? @relation(fields: [uploaded_by_user_id], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "fk_file_uploads_user")
@@index([created_at], map: "idx_file_uploads_created_at")
@@index([entity_type, entity_id], map: "idx_file_uploads_entity")
@@index([reference], map: "idx_file_uploads_reference")
@@index([upload_status], map: "idx_file_uploads_status")
@@index([upload_id], map: "idx_file_uploads_upload_id")
@@index([uploaded_by_user_id], map: "idx_file_uploads_user")
}
model old_passwords {
id BigInt @id @default(autoincrement())
encrypted_password String @db.VarChar(255)
password_archivable_type String @db.VarChar(255)
password_archivable_id Int
created_at DateTime? @db.Timestamp(6)
@@index([password_archivable_type, password_archivable_id], map: "index_password_archivableddu")
}
model pafs_core_account_requests {
id BigInt @id @default(autoincrement())
first_name String @default("") @db.VarChar(255)
last_name String @default("") @db.VarChar(255)
email String @unique(map: "index_pafs_core_account_requests_on_email") @default("") @db.VarChar(255)
organisation String @default("") @db.VarChar(255)
job_title String? @db.VarChar(255)
telephone_number String? @db.VarChar(255)
slug String? @unique(map: "index_pafs_core_account_requests_on_slug") @db.VarChar(255)
terms_accepted Boolean @default(false)
provisioned Boolean @default(false)
created_at DateTime @db.Timestamp(6)
updated_at DateTime @db.Timestamp(6)
}
model pafs_core_area_downloads {
id BigInt @id @default(autoincrement())
area_id Int?
user_id Int?
requested_on DateTime? @db.Timestamp(6)
number_of_proposals Int?
fcerm1_filename String? @db.VarChar(255)
benefit_areas_filename String? @db.VarChar(255)
moderation_filename String? @db.VarChar(255)
number_of_proposals_with_moderation Int?
status String @default("empty") @db.VarChar(255)
funding_calculator_filename String? @db.VarChar(255)
created_at DateTime? @db.Timestamp(6)
updated_at DateTime? @db.Timestamp(6)
progress_current Int? @default(0)
progress_total Int? @default(0)
progress_message String? @db.VarChar(500)
number_of_benefit_areas Int?
@@index([area_id], map: "index_pafs_core_area_downloads_on_area_id")
@@index([status], map: "index_pafs_core_area_downloads_on_status")
@@index([user_id], map: "index_pafs_core_area_downloads_on_user_id")
}
model pafs_core_area_projects {
id BigInt @id @default(autoincrement())
area_id Int
project_id Int @unique(map: "unique_pafs_core_area_projects_project_id")
owner Boolean? @default(false)
created_at DateTime @db.Timestamp(6)
updated_at DateTime @db.Timestamp(6)
@@index([area_id], map: "index_pafs_core_area_projects_on_area_id")
@@index([project_id], map: "index_pafs_core_area_projects_on_project_id")
}
model pafs_core_areas {
id BigInt @id @default(autoincrement())
name String? @db.VarChar(255)
parent_id Int?
area_type String? @db.VarChar(255)
created_at DateTime @db.Timestamp(6)
updated_at DateTime @db.Timestamp(6)
sub_type String? @db.VarChar(255)
identifier String? @db.VarChar(255)
end_date DateTime? @db.Date
@@index([name], map: "index_pafs_core_areas_on_name")
}
model pafs_core_asite_files {
id BigInt @id @default(autoincrement())
asite_submission_id BigInt?
filename String @db.VarChar(255)
checksum String @db.VarChar(255)
}
model pafs_core_asite_submissions {
id BigInt @id @default(autoincrement())
project_id BigInt?
email_sent_at DateTime @db.Timestamp(6)
confirmation_received_at DateTime? @db.Timestamp(6)
status String @default("created") @db.VarChar(255)
}
model pafs_core_bootstraps {
id BigInt @id @default(autoincrement())
fcerm_gia Boolean?
local_levy Boolean?
name String? @db.VarChar(255)
project_type String? @db.VarChar(255)
project_end_financial_year Int?
slug String @unique(map: "index_pafs_core_bootstraps_on_slug") @db.VarChar(255)
creator_id Int?
created_at DateTime @db.Timestamp(6)
updated_at DateTime @db.Timestamp(6)
rma_name String? @db.VarChar(255)
}
model pafs_core_coastal_erosion_protection_outcomes {
id Int @id @default(autoincrement())
project_id BigInt?
financial_year Int
households_at_reduced_risk Int?
households_protected_from_loss_in_next_20_years Int?
households_protected_from_loss_in_20_percent_most_deprived Int?
non_residential_properties Int?
@@index([financial_year], map: "idx_cep_outcomes_on_financial_year")
@@index([project_id], map: "idx_cep_outcomes_on_project_id")
@@index([project_id, financial_year], map: "idx_cep_outcomes_on_project_id_and_fy")
}
model pafs_core_flood_protection2040_outcomes {
id BigInt @id @default(autoincrement())
project_id BigInt?
financial_year Int
households_at_reduced_risk Int?
moved_from_very_significant_and_significant_to_moderate_or_low Int?
households_protected_from_loss_in_20_percent_most_deprived Int?
non_residential_properties Int?
}
model pafs_core_flood_protection_outcomes {
id Int @id @default(autoincrement())
project_id BigInt?
financial_year Int
households_at_reduced_risk Int?
moved_from_very_significant_and_significant_to_moderate_or_low Int?
households_protected_from_loss_in_20_percent_most_deprived Int?
households_protected_through_plp_measures Int?
non_residential_properties Int?
@@index([financial_year], map: "idx_fp_outcomes_on_financial_year")
@@index([project_id], map: "idx_fp_outcomes_on_project_id")
@@index([project_id, financial_year], map: "idx_fp_outcomes_on_project_id_and_fy")
}
model pafs_core_funding_contributors {
id Int @id @default(autoincrement())
name String? @db.VarChar(255)
contributor_type String? @db.VarChar(255)
funding_value_id BigInt?
amount BigInt?
secured Boolean @default(false)
constrained Boolean @default(false)
created_at DateTime @db.Timestamp(6)
updated_at DateTime @db.Timestamp(6)
@@index([funding_value_id, contributor_type], map: "funding_contributors_on_funding_value_id_and_type")
@@index([contributor_type], map: "index_pafs_core_funding_contributors_on_contributor_type")
@@index([funding_value_id], map: "index_pafs_core_funding_contributors_on_funding_value_id")
}
model pafs_core_funding_values {
id BigInt @id @default(autoincrement())
project_id BigInt?
financial_year Int
fcerm_gia BigInt?
local_levy BigInt?
internal_drainage_boards BigInt?
public_contributions BigInt?
private_contributions BigInt?
other_ea_contributions BigInt?
not_yet_identified BigInt?
total BigInt @default(0)
asset_replacement_allowance BigInt?
environment_statutory_funding BigInt?
frequently_flooded_communities BigInt?
other_additional_grant_in_aid BigInt?
other_government_department BigInt?
recovery BigInt?
summer_economic_fund BigInt?
@@index([project_id, financial_year], map: "funding_values_on_project_id_and_financial_year")
@@index([financial_year], map: "index_pafs_core_funding_values_on_financial_year")
}
model pafs_core_nfm_land_use_changes {
id BigInt @id @default(autoincrement())
project_id BigInt
land_use_type String @db.VarChar(50)
area_before_hectares Decimal @db.Decimal(20, 2)
area_after_hectares Decimal @db.Decimal(20, 2)
created_at DateTime @db.Timestamp(6)
updated_at DateTime @db.Timestamp(6)
@@unique([project_id, land_use_type], map: "idx_nfm_land_use_unique")
@@index([project_id], map: "idx_nfm_land_use_project_id")
}
model pafs_core_nfm_measures {
id BigInt @id @default(autoincrement())
project_id BigInt
measure_type String @db.VarChar(100)
area_hectares Decimal? @db.Decimal(20, 2)
storage_volume_m3 Decimal? @db.Decimal(20, 2)
length_km Decimal? @db.Decimal(20, 2)
width_m Decimal? @db.Decimal(20, 2)
created_at DateTime @db.Timestamp(6)
updated_at DateTime @db.Timestamp(6)
@@index([project_id], map: "idx_nfm_measures_project_id")
@@index([measure_type], map: "idx_nfm_measures_type")
}
model pafs_core_projects {
id BigInt @id @default(autoincrement())
reference_number String @db.VarChar(255)
version Int
slug String @unique(map: "index_pafs_core_projects_on_slug") @default("") @db.VarChar(255)
name String? @unique(map: "index_pafs_core_projects_on_name") @db.VarChar(255)
rma_name String? @db.VarChar(255)
project_type String? @db.VarChar(255)
project_intervention_types String? @db.VarChar(255)
main_intervention_type String? @db.VarChar(255)
earliest_start_month Int?
earliest_start_year Int?
project_end_financial_year Int?
project_location String[] @default([])
project_location_zoom_level Int? @default(15)
region String? @db.VarChar(255)
county String? @db.VarChar(255)
parliamentary_constituency String? @db.VarChar(255)
grid_reference String? @db.VarChar(255)
benefit_area_file_name String? @db.VarChar(255)
benefit_area_content_type String? @db.VarChar(255)
benefit_area_file_size Int?
benefit_area_file_updated_at DateTime? @db.Timestamp(6)
benefit_area_file_s3_bucket String? @db.VarChar(255)
benefit_area_file_s3_key String? @db.VarChar(1000)
benefit_area_file_download_url String?
benefit_area_file_download_expiry DateTime? @db.Timestamp(6)
benefit_area String?
benefit_area_centre String[]
benefit_area_zoom_level Int?
start_outline_business_case_month Int?
start_outline_business_case_year Int?
complete_outline_business_case_month Int?
complete_outline_business_case_year Int?
award_contract_month Int?
award_contract_year Int?
start_construction_month Int?
start_construction_year Int?
ready_for_service_month Int?
ready_for_service_year Int?
could_start_early Boolean?
earliest_with_gia_month Int?
earliest_with_gia_year Int?
fcerm_gia Boolean?
local_levy Boolean?
internal_drainage_boards Boolean?
public_contributions Boolean?
public_contributor_names String? @db.VarChar(255)
private_contributions Boolean?
private_contributor_names String? @db.VarChar(255)
other_ea_contributions Boolean?
other_ea_contributor_names String? @db.VarChar(255)
growth_funding Boolean?
not_yet_identified Boolean?
funding_sources_visited Boolean? @default(false)
asset_replacement_allowance Boolean? @default(false)
environment_statutory_funding Boolean? @default(false)
frequently_flooded_communities Boolean? @default(false)
other_additional_grant_in_aid Boolean? @default(false)
other_government_department Boolean? @default(false)
recovery Boolean? @default(false)
summer_economic_fund Boolean? @default(false)
project_risks_protected_against String?
current_flood_fluvial_risk String? @db.VarChar(255)
current_flood_surface_water_risk String? @db.VarChar(255)
current_coastal_erosion_risk String? @db.VarChar(255)
no_properties_at_flood_risk Boolean? @default(false)
properties_benefit_maintaining_assets BigInt?
properties_benefit_50_percent_reduction BigInt?
properties_benefit_less_50_percent_reduction BigInt?
properties_benefit_individual_intervention BigInt?
no_properties_at_coastal_erosion_risk Boolean? @default(false)
properties_benefit_maintaining_assets_coastal BigInt?
properties_benefit_investment_coastal_erosion BigInt?
percent_properties_20_percent_deprived Float?
percent_properties_40_percent_deprived Float?
fluvial_flooding Boolean?
tidal_flooding Boolean?
groundwater_flooding Boolean?
surface_water_flooding Boolean?
sea_flooding Boolean?
reservoir_flooding Boolean?
coastal_erosion Boolean?
main_risk String? @db.VarChar(255)
flood_protection_before Int?
flood_protection_after Int?
coastal_protection_before Int?
coastal_protection_after Int?
reduced_risk_of_households_for_floods Boolean @default(false)
reduced_risk_of_households_for_coastal_erosion Boolean @default(false)
no_properties_affected_by_flooding_2040 Boolean @default(false)
environmental_benefits Boolean?
intertidal_habitat Boolean?
hectares_of_intertidal_habitat_created_or_enhanced Decimal? @db.Decimal(20, 2)
woodland Boolean?
hectares_of_woodland_habitat_created_or_enhanced Decimal? @db.Decimal(20, 2)
wet_woodland Boolean?
hectares_of_wet_woodland_habitat_created_or_enhanced Decimal? @db.Decimal(20, 2)
wetland_or_wet_grassland Boolean?
hectares_of_wetland_or_wet_grassland_created_or_enhanced Decimal? @db.Decimal(20, 2)
grassland Boolean?
hectares_of_grassland_habitat_created_or_enhanced Decimal? @db.Decimal(20, 2)
heathland Boolean?
hectares_of_heathland_created_or_enhanced Decimal? @db.Decimal(20, 2)
ponds_lakes Boolean?
hectares_of_pond_or_lake_habitat_created_or_enhanced Decimal? @db.Decimal(20, 2)
arable_land Boolean?
hectares_of_arable_land_lake_habitat_created_or_enhanced Decimal? @db.Decimal(20, 2)
comprehensive_restoration Boolean?
kilometres_of_watercourse_enhanced_or_created_comprehensive Decimal? @db.Decimal(20, 2)
partial_restoration Boolean?
kilometres_of_watercourse_enhanced_or_created_partial Decimal? @db.Decimal(20, 2)
create_habitat_watercourse Boolean?
kilometres_of_watercourse_enhanced_or_created_single Decimal? @db.Decimal(20, 2)
improve_surface_or_groundwater Boolean?
improve_surface_or_groundwater_amount Float?
improve_river Boolean?
improve_spa_or_sac Boolean?
improve_sssi Boolean?
improve_hpi Boolean?
improve_habitat_amount Float?
improve_river_amount Float?
create_habitat Boolean?
create_habitat_amount Float?
remove_fish_barrier Boolean?
remove_eel_barrier Boolean?
fish_or_eel_amount Float?
approach String?
nfm_selected_measures String?
nfm_land_use_change String?
nfm_landowner_consent String? @db.VarChar(50)
nfm_experience_level String? @db.VarChar(50)
nfm_project_readiness String? @db.VarChar(50)
natural_flood_risk_measures_included Boolean?
river_restoration Boolean?
floodplain_restoration Boolean?
leaky_barriers Boolean?
offline_flood_storage_areas Boolean?
cross_slope_woodland Boolean?
catchment_woodland Boolean?
riparian_woodland Boolean?
floodplain_woodland Boolean?
soil_and_land_management Boolean?
land_and_headwater_drainage_management Boolean?
runoff_pathway_management Boolean?
saltmarsh_mudflats_and_managed_realignment Boolean?
sand_dunes Boolean?
beach_nourishment Boolean?
other_flood_measures String? @db.VarChar(255)
other_flood_measures_selected Boolean?
natural_flood_risk_measures_cost Float?
funding_calculator_file_name String? @db.VarChar(255)
funding_calculator_content_type String? @db.VarChar(255)
funding_calculator_file_size Int?
funding_calculator_updated_at DateTime? @db.Timestamp(6)
strategic_approach Boolean?
raw_partnership_funding_score Float?
adjusted_partnership_funding_score Float?
pv_whole_life_costs Float?
pv_whole_life_benefits Float?
duration_of_benefits Int?
hectares_of_net_water_dependent_habitat_created Float?
hectares_of_net_water_intertidal_habitat_created Float?
kilometres_of_protected_river_improved Float?
consented Boolean @default(false)
wlc_estimated_whole_life_pv_costs BigInt?
wlc_estimated_design_construction_costs BigInt?
wlc_estimated_risk_contingency_costs BigInt?
wlc_estimated_future_costs BigInt?
wlc_estimated_whole_life_pv_benefits BigInt?
wlc_estimated_property_damages_avoided BigInt?
wlc_estimated_environmental_benefits BigInt?
wlc_estimated_recreation_tourism_benefits BigInt?
wlc_estimated_land_value_uplift_benefits BigInt?
urgency_reason String? @db.VarChar(255)
urgency_details String?
urgency_details_updated_at DateTime? @db.Timestamp(6)
confidence_homes_better_protected String? @db.VarChar(20)
confidence_homes_by_gateway_four String? @db.VarChar(20)
confidence_secured_partnership_funding String? @db.VarChar(20)
carbon_cost_build Decimal? @db.Decimal(20, 2)
carbon_cost_operation Decimal? @db.Decimal(20, 2)
carbon_cost_sequestered Decimal? @db.Decimal(20, 2)
carbon_cost_avoided Decimal? @db.Decimal(20, 2)
carbon_savings_net_economic_benefit Decimal? @db.Decimal(20, 2)
carbon_operational_cost_forecast BigInt?
carbon_values_hexdigest String? @db.VarChar(255)
creator_id Int?
submitted_at DateTime? @db.Timestamp(6)
submitted_to_pol DateTime? @db.Timestamp(6)
pending_earliest_start_month Int?
pending_earliest_start_year Int?
pending_financial_year Int?
date_change_requires_confirmation Boolean? @default(false)
is_legacy Boolean? @default(true)
is_revised Boolean? @default(false)
updated_by_type String? @db.VarChar(255)
updated_by_id BigInt?
created_at DateTime @db.Timestamp(6)
updated_at DateTime @db.Timestamp(6)
stale_data_cleared Boolean? @default(false)
benefit_area_file_base64 String?
@@unique([reference_number, version], map: "index_pafs_core_projects_on_reference_number_and_version")
@@index([benefit_area_file_s3_bucket, benefit_area_file_s3_key], map: "idx_core_projects_benefit_area_s3")
@@index([reference_number], map: "index_pafs_core_projects_on_reference_number")
@@index([submitted_to_pol], map: "index_pafs_core_projects_on_submitted_to_pol")
@@index([updated_by_type, updated_by_id], map: "index_pafs_core_projects_on_updated_by")
}
model pafs_core_reference_counters {
id BigInt @id @default(autoincrement())
rfcc_code String @unique(map: "index_pafs_core_reference_counters_on_rfcc_code") @default("") @db.VarChar(255)
high_counter Int @default(0)
low_counter Int @default(0)
created_at DateTime @db.Timestamp(6)
updated_at DateTime @db.Timestamp(6)
}
model pafs_core_states {
id BigInt @id @default(autoincrement())
project_id Int? @unique(map: "unique_pafs_core_states_project_id")
state String @default("draft") @db.VarChar(255)
created_at DateTime? @db.Timestamp(6)
updated_at DateTime? @db.Timestamp(6)
}
model pafs_core_user_areas {
id BigInt @id @default(autoincrement())
created_at DateTime @db.Timestamp(6)
updated_at DateTime @db.Timestamp(6)
user_id BigInt
area_id BigInt
primary Boolean? @default(false)
@@index([area_id], map: "index_pafs_core_user_areas_on_area_id")
@@index([user_id], map: "index_pafs_core_user_areas_on_user_id")
}
model pafs_core_users {
id BigInt @id @default(autoincrement())
email String @unique(map: "index_pafs_core_users_on_email") @default("") @db.VarChar(255)
encrypted_password String @default("") @db.VarChar(255)
reset_password_token String? @unique(map: "index_pafs_core_users_on_reset_password_token") @db.VarChar(255)
reset_password_sent_at DateTime? @db.Timestamp(6)
remember_created_at DateTime? @db.Timestamp(6)
sign_in_count Int @default(0)
current_sign_in_at DateTime? @db.Timestamp(6)
last_sign_in_at DateTime? @db.Timestamp(6)
current_sign_in_ip String? @db.Inet
last_sign_in_ip String? @db.Inet
failed_attempts Int @default(0)
unlock_token String? @unique(map: "index_pafs_core_users_on_unlock_token") @db.VarChar(255)
locked_at DateTime? @db.Timestamp(6)
first_name String @default("") @db.VarChar(255)
last_name String @default("") @db.VarChar(255)
job_title String? @db.VarChar(255)
organisation String @default("") @db.VarChar(255)
telephone_number String? @db.VarChar(255)
status String @default("active") @db.VarChar(255)
inactivity_warning_sent_at DateTime? @db.Timestamp(6)
created_at DateTime @db.Timestamp(6)
updated_at DateTime @db.Timestamp(6)
invitation_token String? @unique(map: "index_pafs_core_users_on_invitation_token") @db.VarChar(255)
invitation_created_at DateTime? @db.Timestamp(6)
invitation_sent_at DateTime? @db.Timestamp(6)
invitation_accepted_at DateTime? @db.Timestamp(6)
invitation_limit Int?
invited_by_id Int?
invited_by_type String? @db.VarChar(255)
invitations_count Int? @default(0)
admin Boolean @default(false)
disabled Boolean @default(false)
unique_session_id String? @db.VarChar(36)
file_uploads file_uploads[]
@@index([disabled], map: "index_pafs_core_users_on_disabled")
@@index([inactivity_warning_sent_at], map: "index_pafs_core_users_on_inactivity_warning_sent_at")
@@index([invitations_count], map: "index_pafs_core_users_on_invitations_count")
@@index([invited_by_id], map: "index_pafs_core_users_on_invited_by_id")
@@index([status], map: "index_pafs_core_users_on_status")
}
model scheduler_locks {
task_name String @id @db.VarChar(255)
locked_by String @db.VarChar(255)
locked_at DateTime @db.Timestamp(6)
expires_at DateTime @db.Timestamp(6)
last_run_at DateTime? @db.Timestamp(6)
@@index([expires_at], map: "idx_scheduler_locks_expires_at")
}
model scheduler_logs {
id BigInt @id @default(autoincrement())
task_name String @db.VarChar(255)
executed_by String @db.VarChar(255)
status String @db.VarChar(50)
started_at DateTime @db.Timestamp(6)
completed_at DateTime? @db.Timestamp(6)
duration_ms Int?
result String?
error_message String?
error_stack String?
trigger_type String @db.VarChar(50)
triggered_by_user_id BigInt?
created_at DateTime @default(now()) @db.Timestamp(6)
@@index([started_at], map: "idx_scheduler_logs_started_at")
@@index([status], map: "idx_scheduler_logs_status")
@@index([task_name], map: "idx_scheduler_logs_task_name")
@@index([task_name, status], map: "idx_scheduler_logs_task_status")
}
model audit_log {
id BigInt @id @default(autoincrement())
model String @db.VarChar(100)
entity_id String @db.VarChar(100)
action String @db.VarChar(20)
changed_by String? @db.VarChar(255)
changed_at DateTime @default(now()) @db.Timestamp(6)
before_data Json?
after_data Json?
diff Json?
@@index([changed_at(sort: Desc)], map: "idx_audit_log_changed_at")
@@index([changed_by], map: "idx_audit_log_changed_by")
@@index([model, entity_id], map: "idx_audit_log_model_entity")
}
model pafs_proposal_submissions {
id BigInt @id @default(autoincrement())
project_id BigInt
reference_number String @db.VarChar(255)
status String @default("pending") @db.VarChar(50)
http_status_code Int?
error_message String?
response_body String?
is_resend Boolean @default(false)
attempted_at DateTime @default(now()) @db.Timestamp(6)
created_at DateTime @default(now()) @db.Timestamp(6)
request_payload Json?
@@index([project_id], map: "idx_proposal_submissions_project_id")
@@index([reference_number], map: "idx_proposal_submissions_reference_number")
@@index([status], map: "idx_proposal_submissions_status")
}