@spfn/auth 0.2.0-beta.87 → 0.2.0-beta.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +333 -18
  2. package/dist/{authenticate-C7w-pLOR.d.ts → authenticate-ZssfqJ7d.d.ts} +150 -9
  3. package/dist/client-proof.d.ts +1 -1
  4. package/dist/client-proof.js +30 -0
  5. package/dist/client-proof.js.map +1 -1
  6. package/dist/config.d.ts +36 -0
  7. package/dist/config.js +18 -0
  8. package/dist/config.js.map +1 -1
  9. package/dist/errors.d.ts +93 -2
  10. package/dist/errors.js +57 -0
  11. package/dist/errors.js.map +1 -1
  12. package/dist/index.d.ts +36 -7
  13. package/dist/index.js +60 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/nextjs/server.d.ts +2 -2
  16. package/dist/server.d.ts +195 -80
  17. package/dist/server.js +515 -106
  18. package/dist/server.js.map +1 -1
  19. package/dist/{session-CGxgH3C9.d.ts → session-CFK4BT25.d.ts} +1 -1
  20. package/dist/{types-1BMx0OX1.d.ts → types-CD95yudz.d.ts} +15 -1
  21. package/migrations/20251125021229_premium_famine/snapshot.json +2641 -0
  22. package/migrations/20260225130050_smooth_the_fury/snapshot.json +2686 -0
  23. package/migrations/20260308141417_deep_iceman/snapshot.json +2686 -0
  24. package/migrations/20260308151309_perfect_deathbird/snapshot.json +2731 -0
  25. package/migrations/20260308201135_concerned_rawhide_kid/snapshot.json +2786 -0
  26. package/migrations/20260629103209_lethal_lifeguard/snapshot.json +2786 -0
  27. package/migrations/20260709073531_easy_hardball/snapshot.json +3119 -0
  28. package/migrations/20260714081434_glossy_major_mapleleaf/snapshot.json +3112 -0
  29. package/migrations/20260804105939_amazing_bushwacker/migration.sql +3 -0
  30. package/migrations/20260804105939_amazing_bushwacker/snapshot.json +3112 -0
  31. package/migrations/20260804110033_fat_piledriver/migration.sql +2 -0
  32. package/migrations/20260804110033_fat_piledriver/snapshot.json +3138 -0
  33. package/package.json +3 -6
  34. package/migrations/meta/0000_snapshot.json +0 -1632
  35. package/migrations/meta/0001_snapshot.json +0 -1660
  36. package/migrations/meta/0002_snapshot.json +0 -1660
  37. package/migrations/meta/0003_snapshot.json +0 -1689
  38. package/migrations/meta/0004_snapshot.json +0 -1721
  39. package/migrations/meta/0005_snapshot.json +0 -1721
  40. package/migrations/meta/0006_snapshot.json +0 -1921
  41. package/migrations/meta/0007_snapshot.json +0 -1916
  42. package/migrations/meta/_journal.json +0 -62
  43. /package/migrations/{0000_premium_famine.sql → 20251125021229_premium_famine/migration.sql} +0 -0
  44. /package/migrations/{0001_smooth_the_fury.sql → 20260225130050_smooth_the_fury/migration.sql} +0 -0
  45. /package/migrations/{0002_deep_iceman.sql → 20260308141417_deep_iceman/migration.sql} +0 -0
  46. /package/migrations/{0003_perfect_deathbird.sql → 20260308151309_perfect_deathbird/migration.sql} +0 -0
  47. /package/migrations/{0004_concerned_rawhide_kid.sql → 20260308201135_concerned_rawhide_kid/migration.sql} +0 -0
  48. /package/migrations/{0005_lethal_lifeguard.sql → 20260629103209_lethal_lifeguard/migration.sql} +0 -0
  49. /package/migrations/{0006_easy_hardball.sql → 20260709073531_easy_hardball/migration.sql} +0 -0
  50. /package/migrations/{0007_glossy_major_mapleleaf.sql → 20260714081434_glossy_major_mapleleaf/migration.sql} +0 -0
@@ -1,1921 +0,0 @@
1
- {
2
- "id": "c8a498b4-f984-4c31-a6af-6736be0f4665",
3
- "prevId": "e0d0fab5-2150-481d-b1b0-fe34ba506b01",
4
- "version": "7",
5
- "dialect": "postgresql",
6
- "tables": {
7
- "spfn_auth.users": {
8
- "name": "users",
9
- "schema": "spfn_auth",
10
- "columns": {
11
- "id": {
12
- "name": "id",
13
- "type": "bigserial",
14
- "primaryKey": true,
15
- "notNull": true
16
- },
17
- "public_id": {
18
- "name": "public_id",
19
- "type": "uuid",
20
- "primaryKey": false,
21
- "notNull": true,
22
- "default": "gen_random_uuid()"
23
- },
24
- "email": {
25
- "name": "email",
26
- "type": "text",
27
- "primaryKey": false,
28
- "notNull": false
29
- },
30
- "phone": {
31
- "name": "phone",
32
- "type": "text",
33
- "primaryKey": false,
34
- "notNull": false
35
- },
36
- "username": {
37
- "name": "username",
38
- "type": "text",
39
- "primaryKey": false,
40
- "notNull": false
41
- },
42
- "password_hash": {
43
- "name": "password_hash",
44
- "type": "text",
45
- "primaryKey": false,
46
- "notNull": false
47
- },
48
- "password_change_required": {
49
- "name": "password_change_required",
50
- "type": "boolean",
51
- "primaryKey": false,
52
- "notNull": true,
53
- "default": false
54
- },
55
- "role_id": {
56
- "name": "role_id",
57
- "type": "bigint",
58
- "primaryKey": false,
59
- "notNull": true
60
- },
61
- "status": {
62
- "name": "status",
63
- "type": "text",
64
- "primaryKey": false,
65
- "notNull": true,
66
- "default": "'active'"
67
- },
68
- "email_verified_at": {
69
- "name": "email_verified_at",
70
- "type": "timestamp with time zone",
71
- "primaryKey": false,
72
- "notNull": false
73
- },
74
- "phone_verified_at": {
75
- "name": "phone_verified_at",
76
- "type": "timestamp with time zone",
77
- "primaryKey": false,
78
- "notNull": false
79
- },
80
- "last_login_at": {
81
- "name": "last_login_at",
82
- "type": "timestamp with time zone",
83
- "primaryKey": false,
84
- "notNull": false
85
- },
86
- "created_at": {
87
- "name": "created_at",
88
- "type": "timestamp with time zone",
89
- "primaryKey": false,
90
- "notNull": true,
91
- "default": "now()"
92
- },
93
- "updated_at": {
94
- "name": "updated_at",
95
- "type": "timestamp with time zone",
96
- "primaryKey": false,
97
- "notNull": true,
98
- "default": "now()"
99
- },
100
- "deleted_at": {
101
- "name": "deleted_at",
102
- "type": "timestamp with time zone",
103
- "primaryKey": false,
104
- "notNull": false
105
- },
106
- "deleted_by": {
107
- "name": "deleted_by",
108
- "type": "text",
109
- "primaryKey": false,
110
- "notNull": false
111
- }
112
- },
113
- "indexes": {
114
- "users_public_id_idx": {
115
- "name": "users_public_id_idx",
116
- "columns": [
117
- {
118
- "expression": "public_id",
119
- "isExpression": false,
120
- "asc": true,
121
- "nulls": "last"
122
- }
123
- ],
124
- "isUnique": false,
125
- "concurrently": false,
126
- "method": "btree",
127
- "with": {}
128
- },
129
- "users_email_idx": {
130
- "name": "users_email_idx",
131
- "columns": [
132
- {
133
- "expression": "email",
134
- "isExpression": false,
135
- "asc": true,
136
- "nulls": "last"
137
- }
138
- ],
139
- "isUnique": false,
140
- "concurrently": false,
141
- "method": "btree",
142
- "with": {}
143
- },
144
- "users_phone_idx": {
145
- "name": "users_phone_idx",
146
- "columns": [
147
- {
148
- "expression": "phone",
149
- "isExpression": false,
150
- "asc": true,
151
- "nulls": "last"
152
- }
153
- ],
154
- "isUnique": false,
155
- "concurrently": false,
156
- "method": "btree",
157
- "with": {}
158
- },
159
- "users_username_idx": {
160
- "name": "users_username_idx",
161
- "columns": [
162
- {
163
- "expression": "username",
164
- "isExpression": false,
165
- "asc": true,
166
- "nulls": "last"
167
- }
168
- ],
169
- "isUnique": false,
170
- "concurrently": false,
171
- "method": "btree",
172
- "with": {}
173
- },
174
- "users_status_idx": {
175
- "name": "users_status_idx",
176
- "columns": [
177
- {
178
- "expression": "status",
179
- "isExpression": false,
180
- "asc": true,
181
- "nulls": "last"
182
- }
183
- ],
184
- "isUnique": false,
185
- "concurrently": false,
186
- "method": "btree",
187
- "with": {}
188
- },
189
- "users_role_id_idx": {
190
- "name": "users_role_id_idx",
191
- "columns": [
192
- {
193
- "expression": "role_id",
194
- "isExpression": false,
195
- "asc": true,
196
- "nulls": "last"
197
- }
198
- ],
199
- "isUnique": false,
200
- "concurrently": false,
201
- "method": "btree",
202
- "with": {}
203
- }
204
- },
205
- "foreignKeys": {
206
- "users_role_id_roles_id_fk": {
207
- "name": "users_role_id_roles_id_fk",
208
- "tableFrom": "users",
209
- "tableTo": "roles",
210
- "schemaTo": "spfn_auth",
211
- "columnsFrom": [
212
- "role_id"
213
- ],
214
- "columnsTo": [
215
- "id"
216
- ],
217
- "onDelete": "cascade",
218
- "onUpdate": "no action"
219
- }
220
- },
221
- "compositePrimaryKeys": {},
222
- "uniqueConstraints": {
223
- "users_public_id_unique": {
224
- "name": "users_public_id_unique",
225
- "nullsNotDistinct": false,
226
- "columns": [
227
- "public_id"
228
- ]
229
- },
230
- "users_email_unique": {
231
- "name": "users_email_unique",
232
- "nullsNotDistinct": false,
233
- "columns": [
234
- "email"
235
- ]
236
- },
237
- "users_phone_unique": {
238
- "name": "users_phone_unique",
239
- "nullsNotDistinct": false,
240
- "columns": [
241
- "phone"
242
- ]
243
- },
244
- "users_username_unique": {
245
- "name": "users_username_unique",
246
- "nullsNotDistinct": false,
247
- "columns": [
248
- "username"
249
- ]
250
- }
251
- },
252
- "policies": {},
253
- "checkConstraints": {
254
- "email_or_phone_check": {
255
- "name": "email_or_phone_check",
256
- "value": "\"spfn_auth\".\"users\".\"email\" IS NOT NULL OR \"spfn_auth\".\"users\".\"phone\" IS NOT NULL"
257
- }
258
- },
259
- "isRLSEnabled": false
260
- },
261
- "spfn_auth.user_profiles": {
262
- "name": "user_profiles",
263
- "schema": "spfn_auth",
264
- "columns": {
265
- "id": {
266
- "name": "id",
267
- "type": "bigserial",
268
- "primaryKey": true,
269
- "notNull": true
270
- },
271
- "user_id": {
272
- "name": "user_id",
273
- "type": "bigint",
274
- "primaryKey": false,
275
- "notNull": true
276
- },
277
- "display_name": {
278
- "name": "display_name",
279
- "type": "text",
280
- "primaryKey": false,
281
- "notNull": false
282
- },
283
- "first_name": {
284
- "name": "first_name",
285
- "type": "text",
286
- "primaryKey": false,
287
- "notNull": false
288
- },
289
- "last_name": {
290
- "name": "last_name",
291
- "type": "text",
292
- "primaryKey": false,
293
- "notNull": false
294
- },
295
- "avatar_url": {
296
- "name": "avatar_url",
297
- "type": "text",
298
- "primaryKey": false,
299
- "notNull": false
300
- },
301
- "bio": {
302
- "name": "bio",
303
- "type": "text",
304
- "primaryKey": false,
305
- "notNull": false
306
- },
307
- "locale": {
308
- "name": "locale",
309
- "type": "text",
310
- "primaryKey": false,
311
- "notNull": false,
312
- "default": "'en'"
313
- },
314
- "timezone": {
315
- "name": "timezone",
316
- "type": "text",
317
- "primaryKey": false,
318
- "notNull": false,
319
- "default": "'UTC'"
320
- },
321
- "date_of_birth": {
322
- "name": "date_of_birth",
323
- "type": "text",
324
- "primaryKey": false,
325
- "notNull": false
326
- },
327
- "gender": {
328
- "name": "gender",
329
- "type": "text",
330
- "primaryKey": false,
331
- "notNull": false
332
- },
333
- "website": {
334
- "name": "website",
335
- "type": "text",
336
- "primaryKey": false,
337
- "notNull": false
338
- },
339
- "location": {
340
- "name": "location",
341
- "type": "text",
342
- "primaryKey": false,
343
- "notNull": false
344
- },
345
- "company": {
346
- "name": "company",
347
- "type": "text",
348
- "primaryKey": false,
349
- "notNull": false
350
- },
351
- "job_title": {
352
- "name": "job_title",
353
- "type": "text",
354
- "primaryKey": false,
355
- "notNull": false
356
- },
357
- "metadata": {
358
- "name": "metadata",
359
- "type": "jsonb",
360
- "primaryKey": false,
361
- "notNull": false
362
- },
363
- "created_at": {
364
- "name": "created_at",
365
- "type": "timestamp with time zone",
366
- "primaryKey": false,
367
- "notNull": true,
368
- "default": "now()"
369
- },
370
- "updated_at": {
371
- "name": "updated_at",
372
- "type": "timestamp with time zone",
373
- "primaryKey": false,
374
- "notNull": true,
375
- "default": "now()"
376
- }
377
- },
378
- "indexes": {
379
- "user_profiles_user_id_idx": {
380
- "name": "user_profiles_user_id_idx",
381
- "columns": [
382
- {
383
- "expression": "user_id",
384
- "isExpression": false,
385
- "asc": true,
386
- "nulls": "last"
387
- }
388
- ],
389
- "isUnique": false,
390
- "concurrently": false,
391
- "method": "btree",
392
- "with": {}
393
- },
394
- "user_profiles_display_name_idx": {
395
- "name": "user_profiles_display_name_idx",
396
- "columns": [
397
- {
398
- "expression": "display_name",
399
- "isExpression": false,
400
- "asc": true,
401
- "nulls": "last"
402
- }
403
- ],
404
- "isUnique": false,
405
- "concurrently": false,
406
- "method": "btree",
407
- "with": {}
408
- },
409
- "user_profiles_locale_idx": {
410
- "name": "user_profiles_locale_idx",
411
- "columns": [
412
- {
413
- "expression": "locale",
414
- "isExpression": false,
415
- "asc": true,
416
- "nulls": "last"
417
- }
418
- ],
419
- "isUnique": false,
420
- "concurrently": false,
421
- "method": "btree",
422
- "with": {}
423
- }
424
- },
425
- "foreignKeys": {
426
- "user_profiles_user_id_users_id_fk": {
427
- "name": "user_profiles_user_id_users_id_fk",
428
- "tableFrom": "user_profiles",
429
- "tableTo": "users",
430
- "schemaTo": "spfn_auth",
431
- "columnsFrom": [
432
- "user_id"
433
- ],
434
- "columnsTo": [
435
- "id"
436
- ],
437
- "onDelete": "cascade",
438
- "onUpdate": "no action"
439
- }
440
- },
441
- "compositePrimaryKeys": {},
442
- "uniqueConstraints": {
443
- "user_profiles_user_id_unique": {
444
- "name": "user_profiles_user_id_unique",
445
- "nullsNotDistinct": false,
446
- "columns": [
447
- "user_id"
448
- ]
449
- }
450
- },
451
- "policies": {},
452
- "checkConstraints": {},
453
- "isRLSEnabled": false
454
- },
455
- "spfn_auth.user_public_keys": {
456
- "name": "user_public_keys",
457
- "schema": "spfn_auth",
458
- "columns": {
459
- "id": {
460
- "name": "id",
461
- "type": "bigserial",
462
- "primaryKey": true,
463
- "notNull": true
464
- },
465
- "user_id": {
466
- "name": "user_id",
467
- "type": "bigint",
468
- "primaryKey": false,
469
- "notNull": true
470
- },
471
- "key_id": {
472
- "name": "key_id",
473
- "type": "text",
474
- "primaryKey": false,
475
- "notNull": true
476
- },
477
- "public_key": {
478
- "name": "public_key",
479
- "type": "text",
480
- "primaryKey": false,
481
- "notNull": true
482
- },
483
- "algorithm": {
484
- "name": "algorithm",
485
- "type": "text",
486
- "primaryKey": false,
487
- "notNull": true,
488
- "default": "'ES256'"
489
- },
490
- "fingerprint": {
491
- "name": "fingerprint",
492
- "type": "text",
493
- "primaryKey": false,
494
- "notNull": true
495
- },
496
- "is_active": {
497
- "name": "is_active",
498
- "type": "boolean",
499
- "primaryKey": false,
500
- "notNull": true,
501
- "default": true
502
- },
503
- "created_at": {
504
- "name": "created_at",
505
- "type": "timestamp with time zone",
506
- "primaryKey": false,
507
- "notNull": true,
508
- "default": "now()"
509
- },
510
- "last_used_at": {
511
- "name": "last_used_at",
512
- "type": "timestamp with time zone",
513
- "primaryKey": false,
514
- "notNull": false
515
- },
516
- "expires_at": {
517
- "name": "expires_at",
518
- "type": "timestamp with time zone",
519
- "primaryKey": false,
520
- "notNull": false
521
- },
522
- "revoked_at": {
523
- "name": "revoked_at",
524
- "type": "timestamp with time zone",
525
- "primaryKey": false,
526
- "notNull": false
527
- },
528
- "revoked_reason": {
529
- "name": "revoked_reason",
530
- "type": "text",
531
- "primaryKey": false,
532
- "notNull": false
533
- }
534
- },
535
- "indexes": {
536
- "user_public_keys_user_id_idx": {
537
- "name": "user_public_keys_user_id_idx",
538
- "columns": [
539
- {
540
- "expression": "user_id",
541
- "isExpression": false,
542
- "asc": true,
543
- "nulls": "last"
544
- }
545
- ],
546
- "isUnique": false,
547
- "concurrently": false,
548
- "method": "btree",
549
- "with": {}
550
- },
551
- "user_public_keys_key_id_idx": {
552
- "name": "user_public_keys_key_id_idx",
553
- "columns": [
554
- {
555
- "expression": "key_id",
556
- "isExpression": false,
557
- "asc": true,
558
- "nulls": "last"
559
- }
560
- ],
561
- "isUnique": false,
562
- "concurrently": false,
563
- "method": "btree",
564
- "with": {}
565
- },
566
- "user_public_keys_active_idx": {
567
- "name": "user_public_keys_active_idx",
568
- "columns": [
569
- {
570
- "expression": "is_active",
571
- "isExpression": false,
572
- "asc": true,
573
- "nulls": "last"
574
- }
575
- ],
576
- "isUnique": false,
577
- "concurrently": false,
578
- "method": "btree",
579
- "with": {}
580
- },
581
- "user_public_keys_fingerprint_idx": {
582
- "name": "user_public_keys_fingerprint_idx",
583
- "columns": [
584
- {
585
- "expression": "fingerprint",
586
- "isExpression": false,
587
- "asc": true,
588
- "nulls": "last"
589
- }
590
- ],
591
- "isUnique": false,
592
- "concurrently": false,
593
- "method": "btree",
594
- "with": {}
595
- }
596
- },
597
- "foreignKeys": {
598
- "user_public_keys_user_id_users_id_fk": {
599
- "name": "user_public_keys_user_id_users_id_fk",
600
- "tableFrom": "user_public_keys",
601
- "tableTo": "users",
602
- "schemaTo": "spfn_auth",
603
- "columnsFrom": [
604
- "user_id"
605
- ],
606
- "columnsTo": [
607
- "id"
608
- ],
609
- "onDelete": "cascade",
610
- "onUpdate": "no action"
611
- }
612
- },
613
- "compositePrimaryKeys": {},
614
- "uniqueConstraints": {
615
- "user_public_keys_key_id_unique": {
616
- "name": "user_public_keys_key_id_unique",
617
- "nullsNotDistinct": false,
618
- "columns": [
619
- "key_id"
620
- ]
621
- }
622
- },
623
- "policies": {},
624
- "checkConstraints": {},
625
- "isRLSEnabled": false
626
- },
627
- "spfn_auth.user_social_accounts": {
628
- "name": "user_social_accounts",
629
- "schema": "spfn_auth",
630
- "columns": {
631
- "id": {
632
- "name": "id",
633
- "type": "bigserial",
634
- "primaryKey": true,
635
- "notNull": true
636
- },
637
- "user_id": {
638
- "name": "user_id",
639
- "type": "bigint",
640
- "primaryKey": false,
641
- "notNull": true
642
- },
643
- "provider": {
644
- "name": "provider",
645
- "type": "text",
646
- "primaryKey": false,
647
- "notNull": true
648
- },
649
- "provider_user_id": {
650
- "name": "provider_user_id",
651
- "type": "text",
652
- "primaryKey": false,
653
- "notNull": true
654
- },
655
- "provider_email": {
656
- "name": "provider_email",
657
- "type": "text",
658
- "primaryKey": false,
659
- "notNull": false
660
- },
661
- "access_token": {
662
- "name": "access_token",
663
- "type": "text",
664
- "primaryKey": false,
665
- "notNull": false
666
- },
667
- "refresh_token": {
668
- "name": "refresh_token",
669
- "type": "text",
670
- "primaryKey": false,
671
- "notNull": false
672
- },
673
- "token_expires_at": {
674
- "name": "token_expires_at",
675
- "type": "timestamp with time zone",
676
- "primaryKey": false,
677
- "notNull": false
678
- },
679
- "created_at": {
680
- "name": "created_at",
681
- "type": "timestamp with time zone",
682
- "primaryKey": false,
683
- "notNull": true,
684
- "default": "now()"
685
- },
686
- "updated_at": {
687
- "name": "updated_at",
688
- "type": "timestamp with time zone",
689
- "primaryKey": false,
690
- "notNull": true,
691
- "default": "now()"
692
- }
693
- },
694
- "indexes": {
695
- "user_social_accounts_user_id_idx": {
696
- "name": "user_social_accounts_user_id_idx",
697
- "columns": [
698
- {
699
- "expression": "user_id",
700
- "isExpression": false,
701
- "asc": true,
702
- "nulls": "last"
703
- }
704
- ],
705
- "isUnique": false,
706
- "concurrently": false,
707
- "method": "btree",
708
- "with": {}
709
- },
710
- "user_social_accounts_provider_idx": {
711
- "name": "user_social_accounts_provider_idx",
712
- "columns": [
713
- {
714
- "expression": "provider",
715
- "isExpression": false,
716
- "asc": true,
717
- "nulls": "last"
718
- }
719
- ],
720
- "isUnique": false,
721
- "concurrently": false,
722
- "method": "btree",
723
- "with": {}
724
- },
725
- "provider_user_unique_idx": {
726
- "name": "provider_user_unique_idx",
727
- "columns": [
728
- {
729
- "expression": "provider",
730
- "isExpression": false,
731
- "asc": true,
732
- "nulls": "last"
733
- },
734
- {
735
- "expression": "provider_user_id",
736
- "isExpression": false,
737
- "asc": true,
738
- "nulls": "last"
739
- }
740
- ],
741
- "isUnique": true,
742
- "concurrently": false,
743
- "method": "btree",
744
- "with": {}
745
- }
746
- },
747
- "foreignKeys": {
748
- "user_social_accounts_user_id_users_id_fk": {
749
- "name": "user_social_accounts_user_id_users_id_fk",
750
- "tableFrom": "user_social_accounts",
751
- "tableTo": "users",
752
- "schemaTo": "spfn_auth",
753
- "columnsFrom": [
754
- "user_id"
755
- ],
756
- "columnsTo": [
757
- "id"
758
- ],
759
- "onDelete": "cascade",
760
- "onUpdate": "no action"
761
- }
762
- },
763
- "compositePrimaryKeys": {},
764
- "uniqueConstraints": {},
765
- "policies": {},
766
- "checkConstraints": {},
767
- "isRLSEnabled": false
768
- },
769
- "spfn_auth.verification_codes": {
770
- "name": "verification_codes",
771
- "schema": "spfn_auth",
772
- "columns": {
773
- "id": {
774
- "name": "id",
775
- "type": "bigserial",
776
- "primaryKey": true,
777
- "notNull": true
778
- },
779
- "target": {
780
- "name": "target",
781
- "type": "text",
782
- "primaryKey": false,
783
- "notNull": true
784
- },
785
- "target_type": {
786
- "name": "target_type",
787
- "type": "text",
788
- "primaryKey": false,
789
- "notNull": true
790
- },
791
- "code": {
792
- "name": "code",
793
- "type": "text",
794
- "primaryKey": false,
795
- "notNull": true
796
- },
797
- "purpose": {
798
- "name": "purpose",
799
- "type": "text",
800
- "primaryKey": false,
801
- "notNull": true
802
- },
803
- "expires_at": {
804
- "name": "expires_at",
805
- "type": "timestamp with time zone",
806
- "primaryKey": false,
807
- "notNull": true
808
- },
809
- "used_at": {
810
- "name": "used_at",
811
- "type": "timestamp with time zone",
812
- "primaryKey": false,
813
- "notNull": false
814
- },
815
- "attempts": {
816
- "name": "attempts",
817
- "type": "integer",
818
- "primaryKey": false,
819
- "notNull": true,
820
- "default": 0
821
- },
822
- "created_at": {
823
- "name": "created_at",
824
- "type": "timestamp with time zone",
825
- "primaryKey": false,
826
- "notNull": true,
827
- "default": "now()"
828
- },
829
- "updated_at": {
830
- "name": "updated_at",
831
- "type": "timestamp with time zone",
832
- "primaryKey": false,
833
- "notNull": true,
834
- "default": "now()"
835
- }
836
- },
837
- "indexes": {
838
- "target_purpose_idx": {
839
- "name": "target_purpose_idx",
840
- "columns": [
841
- {
842
- "expression": "target",
843
- "isExpression": false,
844
- "asc": true,
845
- "nulls": "last"
846
- },
847
- {
848
- "expression": "purpose",
849
- "isExpression": false,
850
- "asc": true,
851
- "nulls": "last"
852
- },
853
- {
854
- "expression": "expires_at",
855
- "isExpression": false,
856
- "asc": true,
857
- "nulls": "last"
858
- }
859
- ],
860
- "isUnique": false,
861
- "concurrently": false,
862
- "method": "btree",
863
- "with": {}
864
- }
865
- },
866
- "foreignKeys": {},
867
- "compositePrimaryKeys": {},
868
- "uniqueConstraints": {},
869
- "policies": {},
870
- "checkConstraints": {
871
- "attempts_limit_check": {
872
- "name": "attempts_limit_check",
873
- "value": "\"spfn_auth\".\"verification_codes\".\"attempts\" >= 0 AND \"spfn_auth\".\"verification_codes\".\"attempts\" <= 10"
874
- }
875
- },
876
- "isRLSEnabled": false
877
- },
878
- "spfn_auth.user_invitations": {
879
- "name": "user_invitations",
880
- "schema": "spfn_auth",
881
- "columns": {
882
- "id": {
883
- "name": "id",
884
- "type": "bigserial",
885
- "primaryKey": true,
886
- "notNull": true
887
- },
888
- "email": {
889
- "name": "email",
890
- "type": "text",
891
- "primaryKey": false,
892
- "notNull": true
893
- },
894
- "token": {
895
- "name": "token",
896
- "type": "text",
897
- "primaryKey": false,
898
- "notNull": true
899
- },
900
- "role_id": {
901
- "name": "role_id",
902
- "type": "bigint",
903
- "primaryKey": false,
904
- "notNull": true
905
- },
906
- "invited_by_id": {
907
- "name": "invited_by_id",
908
- "type": "bigint",
909
- "primaryKey": false,
910
- "notNull": true
911
- },
912
- "status": {
913
- "name": "status",
914
- "type": "text",
915
- "primaryKey": false,
916
- "notNull": true,
917
- "default": "'pending'"
918
- },
919
- "expires_at": {
920
- "name": "expires_at",
921
- "type": "timestamp with time zone",
922
- "primaryKey": false,
923
- "notNull": true
924
- },
925
- "accepted_at": {
926
- "name": "accepted_at",
927
- "type": "timestamp with time zone",
928
- "primaryKey": false,
929
- "notNull": false
930
- },
931
- "cancelled_at": {
932
- "name": "cancelled_at",
933
- "type": "timestamp with time zone",
934
- "primaryKey": false,
935
- "notNull": false
936
- },
937
- "metadata": {
938
- "name": "metadata",
939
- "type": "jsonb",
940
- "primaryKey": false,
941
- "notNull": false
942
- },
943
- "created_at": {
944
- "name": "created_at",
945
- "type": "timestamp with time zone",
946
- "primaryKey": false,
947
- "notNull": true,
948
- "default": "now()"
949
- },
950
- "updated_at": {
951
- "name": "updated_at",
952
- "type": "timestamp with time zone",
953
- "primaryKey": false,
954
- "notNull": true,
955
- "default": "now()"
956
- }
957
- },
958
- "indexes": {
959
- "invitations_token_idx": {
960
- "name": "invitations_token_idx",
961
- "columns": [
962
- {
963
- "expression": "token",
964
- "isExpression": false,
965
- "asc": true,
966
- "nulls": "last"
967
- }
968
- ],
969
- "isUnique": false,
970
- "concurrently": false,
971
- "method": "btree",
972
- "with": {}
973
- },
974
- "invitations_email_idx": {
975
- "name": "invitations_email_idx",
976
- "columns": [
977
- {
978
- "expression": "email",
979
- "isExpression": false,
980
- "asc": true,
981
- "nulls": "last"
982
- }
983
- ],
984
- "isUnique": false,
985
- "concurrently": false,
986
- "method": "btree",
987
- "with": {}
988
- },
989
- "invitations_status_idx": {
990
- "name": "invitations_status_idx",
991
- "columns": [
992
- {
993
- "expression": "status",
994
- "isExpression": false,
995
- "asc": true,
996
- "nulls": "last"
997
- }
998
- ],
999
- "isUnique": false,
1000
- "concurrently": false,
1001
- "method": "btree",
1002
- "with": {}
1003
- },
1004
- "invitations_invited_by_idx": {
1005
- "name": "invitations_invited_by_idx",
1006
- "columns": [
1007
- {
1008
- "expression": "invited_by_id",
1009
- "isExpression": false,
1010
- "asc": true,
1011
- "nulls": "last"
1012
- }
1013
- ],
1014
- "isUnique": false,
1015
- "concurrently": false,
1016
- "method": "btree",
1017
- "with": {}
1018
- },
1019
- "invitations_expires_at_idx": {
1020
- "name": "invitations_expires_at_idx",
1021
- "columns": [
1022
- {
1023
- "expression": "expires_at",
1024
- "isExpression": false,
1025
- "asc": true,
1026
- "nulls": "last"
1027
- }
1028
- ],
1029
- "isUnique": false,
1030
- "concurrently": false,
1031
- "method": "btree",
1032
- "with": {}
1033
- },
1034
- "invitations_role_id_idx": {
1035
- "name": "invitations_role_id_idx",
1036
- "columns": [
1037
- {
1038
- "expression": "role_id",
1039
- "isExpression": false,
1040
- "asc": true,
1041
- "nulls": "last"
1042
- }
1043
- ],
1044
- "isUnique": false,
1045
- "concurrently": false,
1046
- "method": "btree",
1047
- "with": {}
1048
- }
1049
- },
1050
- "foreignKeys": {
1051
- "user_invitations_role_id_roles_id_fk": {
1052
- "name": "user_invitations_role_id_roles_id_fk",
1053
- "tableFrom": "user_invitations",
1054
- "tableTo": "roles",
1055
- "schemaTo": "spfn_auth",
1056
- "columnsFrom": [
1057
- "role_id"
1058
- ],
1059
- "columnsTo": [
1060
- "id"
1061
- ],
1062
- "onDelete": "cascade",
1063
- "onUpdate": "no action"
1064
- },
1065
- "user_invitations_invited_by_id_users_id_fk": {
1066
- "name": "user_invitations_invited_by_id_users_id_fk",
1067
- "tableFrom": "user_invitations",
1068
- "tableTo": "users",
1069
- "schemaTo": "spfn_auth",
1070
- "columnsFrom": [
1071
- "invited_by_id"
1072
- ],
1073
- "columnsTo": [
1074
- "id"
1075
- ],
1076
- "onDelete": "cascade",
1077
- "onUpdate": "no action"
1078
- }
1079
- },
1080
- "compositePrimaryKeys": {},
1081
- "uniqueConstraints": {
1082
- "user_invitations_token_unique": {
1083
- "name": "user_invitations_token_unique",
1084
- "nullsNotDistinct": false,
1085
- "columns": [
1086
- "token"
1087
- ]
1088
- }
1089
- },
1090
- "policies": {},
1091
- "checkConstraints": {},
1092
- "isRLSEnabled": false
1093
- },
1094
- "spfn_auth.account_deletion_requests": {
1095
- "name": "account_deletion_requests",
1096
- "schema": "spfn_auth",
1097
- "columns": {
1098
- "id": {
1099
- "name": "id",
1100
- "type": "bigserial",
1101
- "primaryKey": true,
1102
- "notNull": true
1103
- },
1104
- "user_id": {
1105
- "name": "user_id",
1106
- "type": "bigint",
1107
- "primaryKey": false,
1108
- "notNull": false
1109
- },
1110
- "user_public_id": {
1111
- "name": "user_public_id",
1112
- "type": "text",
1113
- "primaryKey": false,
1114
- "notNull": true
1115
- },
1116
- "requested_at": {
1117
- "name": "requested_at",
1118
- "type": "timestamp with time zone",
1119
- "primaryKey": false,
1120
- "notNull": true,
1121
- "default": "now()"
1122
- },
1123
- "purge_scheduled_at": {
1124
- "name": "purge_scheduled_at",
1125
- "type": "timestamp with time zone",
1126
- "primaryKey": false,
1127
- "notNull": true
1128
- },
1129
- "status": {
1130
- "name": "status",
1131
- "type": "text",
1132
- "primaryKey": false,
1133
- "notNull": true,
1134
- "default": "'pending'"
1135
- },
1136
- "requested_by": {
1137
- "name": "requested_by",
1138
- "type": "text",
1139
- "primaryKey": false,
1140
- "notNull": true,
1141
- "default": "'self'"
1142
- },
1143
- "reason": {
1144
- "name": "reason",
1145
- "type": "text",
1146
- "primaryKey": false,
1147
- "notNull": false
1148
- },
1149
- "cancelled_at": {
1150
- "name": "cancelled_at",
1151
- "type": "timestamp with time zone",
1152
- "primaryKey": false,
1153
- "notNull": false
1154
- },
1155
- "completed_at": {
1156
- "name": "completed_at",
1157
- "type": "timestamp with time zone",
1158
- "primaryKey": false,
1159
- "notNull": false
1160
- },
1161
- "purge_strategy": {
1162
- "name": "purge_strategy",
1163
- "type": "text",
1164
- "primaryKey": false,
1165
- "notNull": false
1166
- },
1167
- "created_at": {
1168
- "name": "created_at",
1169
- "type": "timestamp with time zone",
1170
- "primaryKey": false,
1171
- "notNull": true,
1172
- "default": "now()"
1173
- },
1174
- "updated_at": {
1175
- "name": "updated_at",
1176
- "type": "timestamp with time zone",
1177
- "primaryKey": false,
1178
- "notNull": true,
1179
- "default": "now()"
1180
- }
1181
- },
1182
- "indexes": {
1183
- "account_deletion_requests_user_id_idx": {
1184
- "name": "account_deletion_requests_user_id_idx",
1185
- "columns": [
1186
- {
1187
- "expression": "user_id",
1188
- "isExpression": false,
1189
- "asc": true,
1190
- "nulls": "last"
1191
- }
1192
- ],
1193
- "isUnique": false,
1194
- "concurrently": false,
1195
- "method": "btree",
1196
- "with": {}
1197
- },
1198
- "account_deletion_requests_status_idx": {
1199
- "name": "account_deletion_requests_status_idx",
1200
- "columns": [
1201
- {
1202
- "expression": "status",
1203
- "isExpression": false,
1204
- "asc": true,
1205
- "nulls": "last"
1206
- }
1207
- ],
1208
- "isUnique": false,
1209
- "concurrently": false,
1210
- "method": "btree",
1211
- "with": {}
1212
- },
1213
- "account_deletion_requests_purge_scheduled_at_idx": {
1214
- "name": "account_deletion_requests_purge_scheduled_at_idx",
1215
- "columns": [
1216
- {
1217
- "expression": "purge_scheduled_at",
1218
- "isExpression": false,
1219
- "asc": true,
1220
- "nulls": "last"
1221
- }
1222
- ],
1223
- "isUnique": false,
1224
- "concurrently": false,
1225
- "method": "btree",
1226
- "with": {}
1227
- },
1228
- "account_deletion_requests_user_public_id_idx": {
1229
- "name": "account_deletion_requests_user_public_id_idx",
1230
- "columns": [
1231
- {
1232
- "expression": "user_public_id",
1233
- "isExpression": false,
1234
- "asc": true,
1235
- "nulls": "last"
1236
- }
1237
- ],
1238
- "isUnique": false,
1239
- "concurrently": false,
1240
- "method": "btree",
1241
- "with": {}
1242
- },
1243
- "account_deletion_requests_user_pending_unique_idx": {
1244
- "name": "account_deletion_requests_user_pending_unique_idx",
1245
- "columns": [
1246
- {
1247
- "expression": "user_id",
1248
- "isExpression": false,
1249
- "asc": true,
1250
- "nulls": "last"
1251
- }
1252
- ],
1253
- "isUnique": true,
1254
- "where": "\"spfn_auth\".\"account_deletion_requests\".\"status\" = 'pending'",
1255
- "concurrently": false,
1256
- "method": "btree",
1257
- "with": {}
1258
- }
1259
- },
1260
- "foreignKeys": {
1261
- "account_deletion_requests_user_id_users_id_fk": {
1262
- "name": "account_deletion_requests_user_id_users_id_fk",
1263
- "tableFrom": "account_deletion_requests",
1264
- "tableTo": "users",
1265
- "schemaTo": "spfn_auth",
1266
- "columnsFrom": [
1267
- "user_id"
1268
- ],
1269
- "columnsTo": [
1270
- "id"
1271
- ],
1272
- "onDelete": "set null",
1273
- "onUpdate": "no action"
1274
- }
1275
- },
1276
- "compositePrimaryKeys": {},
1277
- "uniqueConstraints": {},
1278
- "policies": {},
1279
- "checkConstraints": {},
1280
- "isRLSEnabled": false
1281
- },
1282
- "spfn_auth.roles": {
1283
- "name": "roles",
1284
- "schema": "spfn_auth",
1285
- "columns": {
1286
- "id": {
1287
- "name": "id",
1288
- "type": "bigserial",
1289
- "primaryKey": true,
1290
- "notNull": true
1291
- },
1292
- "name": {
1293
- "name": "name",
1294
- "type": "text",
1295
- "primaryKey": false,
1296
- "notNull": true
1297
- },
1298
- "display_name": {
1299
- "name": "display_name",
1300
- "type": "text",
1301
- "primaryKey": false,
1302
- "notNull": true
1303
- },
1304
- "description": {
1305
- "name": "description",
1306
- "type": "text",
1307
- "primaryKey": false,
1308
- "notNull": false
1309
- },
1310
- "is_builtin": {
1311
- "name": "is_builtin",
1312
- "type": "boolean",
1313
- "primaryKey": false,
1314
- "notNull": true,
1315
- "default": false
1316
- },
1317
- "is_system": {
1318
- "name": "is_system",
1319
- "type": "boolean",
1320
- "primaryKey": false,
1321
- "notNull": true,
1322
- "default": false
1323
- },
1324
- "is_active": {
1325
- "name": "is_active",
1326
- "type": "boolean",
1327
- "primaryKey": false,
1328
- "notNull": true,
1329
- "default": true
1330
- },
1331
- "priority": {
1332
- "name": "priority",
1333
- "type": "integer",
1334
- "primaryKey": false,
1335
- "notNull": true,
1336
- "default": 10
1337
- },
1338
- "created_at": {
1339
- "name": "created_at",
1340
- "type": "timestamp with time zone",
1341
- "primaryKey": false,
1342
- "notNull": true,
1343
- "default": "now()"
1344
- },
1345
- "updated_at": {
1346
- "name": "updated_at",
1347
- "type": "timestamp with time zone",
1348
- "primaryKey": false,
1349
- "notNull": true,
1350
- "default": "now()"
1351
- }
1352
- },
1353
- "indexes": {
1354
- "roles_name_idx": {
1355
- "name": "roles_name_idx",
1356
- "columns": [
1357
- {
1358
- "expression": "name",
1359
- "isExpression": false,
1360
- "asc": true,
1361
- "nulls": "last"
1362
- }
1363
- ],
1364
- "isUnique": false,
1365
- "concurrently": false,
1366
- "method": "btree",
1367
- "with": {}
1368
- },
1369
- "roles_is_system_idx": {
1370
- "name": "roles_is_system_idx",
1371
- "columns": [
1372
- {
1373
- "expression": "is_system",
1374
- "isExpression": false,
1375
- "asc": true,
1376
- "nulls": "last"
1377
- }
1378
- ],
1379
- "isUnique": false,
1380
- "concurrently": false,
1381
- "method": "btree",
1382
- "with": {}
1383
- },
1384
- "roles_is_active_idx": {
1385
- "name": "roles_is_active_idx",
1386
- "columns": [
1387
- {
1388
- "expression": "is_active",
1389
- "isExpression": false,
1390
- "asc": true,
1391
- "nulls": "last"
1392
- }
1393
- ],
1394
- "isUnique": false,
1395
- "concurrently": false,
1396
- "method": "btree",
1397
- "with": {}
1398
- },
1399
- "roles_is_builtin_idx": {
1400
- "name": "roles_is_builtin_idx",
1401
- "columns": [
1402
- {
1403
- "expression": "is_builtin",
1404
- "isExpression": false,
1405
- "asc": true,
1406
- "nulls": "last"
1407
- }
1408
- ],
1409
- "isUnique": false,
1410
- "concurrently": false,
1411
- "method": "btree",
1412
- "with": {}
1413
- },
1414
- "roles_priority_idx": {
1415
- "name": "roles_priority_idx",
1416
- "columns": [
1417
- {
1418
- "expression": "priority",
1419
- "isExpression": false,
1420
- "asc": true,
1421
- "nulls": "last"
1422
- }
1423
- ],
1424
- "isUnique": false,
1425
- "concurrently": false,
1426
- "method": "btree",
1427
- "with": {}
1428
- }
1429
- },
1430
- "foreignKeys": {},
1431
- "compositePrimaryKeys": {},
1432
- "uniqueConstraints": {
1433
- "roles_name_unique": {
1434
- "name": "roles_name_unique",
1435
- "nullsNotDistinct": false,
1436
- "columns": [
1437
- "name"
1438
- ]
1439
- }
1440
- },
1441
- "policies": {},
1442
- "checkConstraints": {},
1443
- "isRLSEnabled": false
1444
- },
1445
- "spfn_auth.permissions": {
1446
- "name": "permissions",
1447
- "schema": "spfn_auth",
1448
- "columns": {
1449
- "id": {
1450
- "name": "id",
1451
- "type": "bigserial",
1452
- "primaryKey": true,
1453
- "notNull": true
1454
- },
1455
- "name": {
1456
- "name": "name",
1457
- "type": "text",
1458
- "primaryKey": false,
1459
- "notNull": true
1460
- },
1461
- "display_name": {
1462
- "name": "display_name",
1463
- "type": "text",
1464
- "primaryKey": false,
1465
- "notNull": true
1466
- },
1467
- "description": {
1468
- "name": "description",
1469
- "type": "text",
1470
- "primaryKey": false,
1471
- "notNull": false
1472
- },
1473
- "category": {
1474
- "name": "category",
1475
- "type": "text",
1476
- "primaryKey": false,
1477
- "notNull": false
1478
- },
1479
- "is_builtin": {
1480
- "name": "is_builtin",
1481
- "type": "boolean",
1482
- "primaryKey": false,
1483
- "notNull": true,
1484
- "default": false
1485
- },
1486
- "is_system": {
1487
- "name": "is_system",
1488
- "type": "boolean",
1489
- "primaryKey": false,
1490
- "notNull": true,
1491
- "default": false
1492
- },
1493
- "is_active": {
1494
- "name": "is_active",
1495
- "type": "boolean",
1496
- "primaryKey": false,
1497
- "notNull": true,
1498
- "default": true
1499
- },
1500
- "metadata": {
1501
- "name": "metadata",
1502
- "type": "jsonb",
1503
- "primaryKey": false,
1504
- "notNull": false
1505
- },
1506
- "created_at": {
1507
- "name": "created_at",
1508
- "type": "timestamp with time zone",
1509
- "primaryKey": false,
1510
- "notNull": true,
1511
- "default": "now()"
1512
- },
1513
- "updated_at": {
1514
- "name": "updated_at",
1515
- "type": "timestamp with time zone",
1516
- "primaryKey": false,
1517
- "notNull": true,
1518
- "default": "now()"
1519
- }
1520
- },
1521
- "indexes": {
1522
- "permissions_name_idx": {
1523
- "name": "permissions_name_idx",
1524
- "columns": [
1525
- {
1526
- "expression": "name",
1527
- "isExpression": false,
1528
- "asc": true,
1529
- "nulls": "last"
1530
- }
1531
- ],
1532
- "isUnique": false,
1533
- "concurrently": false,
1534
- "method": "btree",
1535
- "with": {}
1536
- },
1537
- "permissions_category_idx": {
1538
- "name": "permissions_category_idx",
1539
- "columns": [
1540
- {
1541
- "expression": "category",
1542
- "isExpression": false,
1543
- "asc": true,
1544
- "nulls": "last"
1545
- }
1546
- ],
1547
- "isUnique": false,
1548
- "concurrently": false,
1549
- "method": "btree",
1550
- "with": {}
1551
- },
1552
- "permissions_is_system_idx": {
1553
- "name": "permissions_is_system_idx",
1554
- "columns": [
1555
- {
1556
- "expression": "is_system",
1557
- "isExpression": false,
1558
- "asc": true,
1559
- "nulls": "last"
1560
- }
1561
- ],
1562
- "isUnique": false,
1563
- "concurrently": false,
1564
- "method": "btree",
1565
- "with": {}
1566
- },
1567
- "permissions_is_active_idx": {
1568
- "name": "permissions_is_active_idx",
1569
- "columns": [
1570
- {
1571
- "expression": "is_active",
1572
- "isExpression": false,
1573
- "asc": true,
1574
- "nulls": "last"
1575
- }
1576
- ],
1577
- "isUnique": false,
1578
- "concurrently": false,
1579
- "method": "btree",
1580
- "with": {}
1581
- },
1582
- "permissions_is_builtin_idx": {
1583
- "name": "permissions_is_builtin_idx",
1584
- "columns": [
1585
- {
1586
- "expression": "is_builtin",
1587
- "isExpression": false,
1588
- "asc": true,
1589
- "nulls": "last"
1590
- }
1591
- ],
1592
- "isUnique": false,
1593
- "concurrently": false,
1594
- "method": "btree",
1595
- "with": {}
1596
- }
1597
- },
1598
- "foreignKeys": {},
1599
- "compositePrimaryKeys": {},
1600
- "uniqueConstraints": {
1601
- "permissions_name_unique": {
1602
- "name": "permissions_name_unique",
1603
- "nullsNotDistinct": false,
1604
- "columns": [
1605
- "name"
1606
- ]
1607
- }
1608
- },
1609
- "policies": {},
1610
- "checkConstraints": {},
1611
- "isRLSEnabled": false
1612
- },
1613
- "spfn_auth.role_permissions": {
1614
- "name": "role_permissions",
1615
- "schema": "spfn_auth",
1616
- "columns": {
1617
- "id": {
1618
- "name": "id",
1619
- "type": "bigserial",
1620
- "primaryKey": true,
1621
- "notNull": true
1622
- },
1623
- "role_id": {
1624
- "name": "role_id",
1625
- "type": "bigint",
1626
- "primaryKey": false,
1627
- "notNull": true
1628
- },
1629
- "permission_id": {
1630
- "name": "permission_id",
1631
- "type": "bigint",
1632
- "primaryKey": false,
1633
- "notNull": true
1634
- },
1635
- "created_at": {
1636
- "name": "created_at",
1637
- "type": "timestamp with time zone",
1638
- "primaryKey": false,
1639
- "notNull": true,
1640
- "default": "now()"
1641
- },
1642
- "updated_at": {
1643
- "name": "updated_at",
1644
- "type": "timestamp with time zone",
1645
- "primaryKey": false,
1646
- "notNull": true,
1647
- "default": "now()"
1648
- }
1649
- },
1650
- "indexes": {
1651
- "role_permissions_role_id_idx": {
1652
- "name": "role_permissions_role_id_idx",
1653
- "columns": [
1654
- {
1655
- "expression": "role_id",
1656
- "isExpression": false,
1657
- "asc": true,
1658
- "nulls": "last"
1659
- }
1660
- ],
1661
- "isUnique": false,
1662
- "concurrently": false,
1663
- "method": "btree",
1664
- "with": {}
1665
- },
1666
- "role_permissions_permission_id_idx": {
1667
- "name": "role_permissions_permission_id_idx",
1668
- "columns": [
1669
- {
1670
- "expression": "permission_id",
1671
- "isExpression": false,
1672
- "asc": true,
1673
- "nulls": "last"
1674
- }
1675
- ],
1676
- "isUnique": false,
1677
- "concurrently": false,
1678
- "method": "btree",
1679
- "with": {}
1680
- }
1681
- },
1682
- "foreignKeys": {
1683
- "role_permissions_role_id_roles_id_fk": {
1684
- "name": "role_permissions_role_id_roles_id_fk",
1685
- "tableFrom": "role_permissions",
1686
- "tableTo": "roles",
1687
- "schemaTo": "spfn_auth",
1688
- "columnsFrom": [
1689
- "role_id"
1690
- ],
1691
- "columnsTo": [
1692
- "id"
1693
- ],
1694
- "onDelete": "cascade",
1695
- "onUpdate": "no action"
1696
- },
1697
- "role_permissions_permission_id_permissions_id_fk": {
1698
- "name": "role_permissions_permission_id_permissions_id_fk",
1699
- "tableFrom": "role_permissions",
1700
- "tableTo": "permissions",
1701
- "schemaTo": "spfn_auth",
1702
- "columnsFrom": [
1703
- "permission_id"
1704
- ],
1705
- "columnsTo": [
1706
- "id"
1707
- ],
1708
- "onDelete": "cascade",
1709
- "onUpdate": "no action"
1710
- }
1711
- },
1712
- "compositePrimaryKeys": {},
1713
- "uniqueConstraints": {
1714
- "role_permissions_unique": {
1715
- "name": "role_permissions_unique",
1716
- "nullsNotDistinct": false,
1717
- "columns": [
1718
- "role_id",
1719
- "permission_id"
1720
- ]
1721
- }
1722
- },
1723
- "policies": {},
1724
- "checkConstraints": {},
1725
- "isRLSEnabled": false
1726
- },
1727
- "spfn_auth.user_permissions": {
1728
- "name": "user_permissions",
1729
- "schema": "spfn_auth",
1730
- "columns": {
1731
- "id": {
1732
- "name": "id",
1733
- "type": "bigserial",
1734
- "primaryKey": true,
1735
- "notNull": true
1736
- },
1737
- "user_id": {
1738
- "name": "user_id",
1739
- "type": "bigint",
1740
- "primaryKey": false,
1741
- "notNull": true
1742
- },
1743
- "permission_id": {
1744
- "name": "permission_id",
1745
- "type": "bigint",
1746
- "primaryKey": false,
1747
- "notNull": true
1748
- },
1749
- "granted": {
1750
- "name": "granted",
1751
- "type": "boolean",
1752
- "primaryKey": false,
1753
- "notNull": true,
1754
- "default": true
1755
- },
1756
- "reason": {
1757
- "name": "reason",
1758
- "type": "text",
1759
- "primaryKey": false,
1760
- "notNull": false
1761
- },
1762
- "expires_at": {
1763
- "name": "expires_at",
1764
- "type": "timestamp with time zone",
1765
- "primaryKey": false,
1766
- "notNull": false
1767
- },
1768
- "created_at": {
1769
- "name": "created_at",
1770
- "type": "timestamp with time zone",
1771
- "primaryKey": false,
1772
- "notNull": true,
1773
- "default": "now()"
1774
- },
1775
- "updated_at": {
1776
- "name": "updated_at",
1777
- "type": "timestamp with time zone",
1778
- "primaryKey": false,
1779
- "notNull": true,
1780
- "default": "now()"
1781
- }
1782
- },
1783
- "indexes": {
1784
- "user_permissions_user_id_idx": {
1785
- "name": "user_permissions_user_id_idx",
1786
- "columns": [
1787
- {
1788
- "expression": "user_id",
1789
- "isExpression": false,
1790
- "asc": true,
1791
- "nulls": "last"
1792
- }
1793
- ],
1794
- "isUnique": false,
1795
- "concurrently": false,
1796
- "method": "btree",
1797
- "with": {}
1798
- },
1799
- "user_permissions_permission_id_idx": {
1800
- "name": "user_permissions_permission_id_idx",
1801
- "columns": [
1802
- {
1803
- "expression": "permission_id",
1804
- "isExpression": false,
1805
- "asc": true,
1806
- "nulls": "last"
1807
- }
1808
- ],
1809
- "isUnique": false,
1810
- "concurrently": false,
1811
- "method": "btree",
1812
- "with": {}
1813
- },
1814
- "user_permissions_expires_at_idx": {
1815
- "name": "user_permissions_expires_at_idx",
1816
- "columns": [
1817
- {
1818
- "expression": "expires_at",
1819
- "isExpression": false,
1820
- "asc": true,
1821
- "nulls": "last"
1822
- }
1823
- ],
1824
- "isUnique": false,
1825
- "concurrently": false,
1826
- "method": "btree",
1827
- "with": {}
1828
- }
1829
- },
1830
- "foreignKeys": {
1831
- "user_permissions_user_id_users_id_fk": {
1832
- "name": "user_permissions_user_id_users_id_fk",
1833
- "tableFrom": "user_permissions",
1834
- "tableTo": "users",
1835
- "schemaTo": "spfn_auth",
1836
- "columnsFrom": [
1837
- "user_id"
1838
- ],
1839
- "columnsTo": [
1840
- "id"
1841
- ],
1842
- "onDelete": "cascade",
1843
- "onUpdate": "no action"
1844
- },
1845
- "user_permissions_permission_id_permissions_id_fk": {
1846
- "name": "user_permissions_permission_id_permissions_id_fk",
1847
- "tableFrom": "user_permissions",
1848
- "tableTo": "permissions",
1849
- "schemaTo": "spfn_auth",
1850
- "columnsFrom": [
1851
- "permission_id"
1852
- ],
1853
- "columnsTo": [
1854
- "id"
1855
- ],
1856
- "onDelete": "cascade",
1857
- "onUpdate": "no action"
1858
- }
1859
- },
1860
- "compositePrimaryKeys": {},
1861
- "uniqueConstraints": {
1862
- "user_permissions_unique": {
1863
- "name": "user_permissions_unique",
1864
- "nullsNotDistinct": false,
1865
- "columns": [
1866
- "user_id",
1867
- "permission_id"
1868
- ]
1869
- }
1870
- },
1871
- "policies": {},
1872
- "checkConstraints": {},
1873
- "isRLSEnabled": false
1874
- },
1875
- "spfn_auth.auth_metadata": {
1876
- "name": "auth_metadata",
1877
- "schema": "spfn_auth",
1878
- "columns": {
1879
- "key": {
1880
- "name": "key",
1881
- "type": "text",
1882
- "primaryKey": true,
1883
- "notNull": true
1884
- },
1885
- "value": {
1886
- "name": "value",
1887
- "type": "text",
1888
- "primaryKey": false,
1889
- "notNull": true
1890
- },
1891
- "updated_at": {
1892
- "name": "updated_at",
1893
- "type": "timestamp with time zone",
1894
- "primaryKey": false,
1895
- "notNull": true,
1896
- "default": "now()"
1897
- }
1898
- },
1899
- "indexes": {},
1900
- "foreignKeys": {},
1901
- "compositePrimaryKeys": {},
1902
- "uniqueConstraints": {},
1903
- "policies": {},
1904
- "checkConstraints": {},
1905
- "isRLSEnabled": false
1906
- }
1907
- },
1908
- "enums": {},
1909
- "schemas": {
1910
- "spfn_auth": "spfn_auth"
1911
- },
1912
- "sequences": {},
1913
- "roles": {},
1914
- "policies": {},
1915
- "views": {},
1916
- "_meta": {
1917
- "columns": {},
1918
- "schemas": {},
1919
- "tables": {}
1920
- }
1921
- }