@authhero/drizzle 0.38.2 → 0.40.0

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "6",
3
3
  "dialect": "sqlite",
4
- "id": "ab4ec13b-e783-4cf8-a351-d433e6170867",
4
+ "id": "c20336e7-de92-4630-8ad4-ac057ec289ff",
5
5
  "prevId": "00000000-0000-0000-0000-000000000000",
6
6
  "tables": {
7
7
  "tenants": {
@@ -383,8 +383,12 @@
383
383
  "name": "passwords_tenant_id_tenants_id_fk",
384
384
  "tableFrom": "passwords",
385
385
  "tableTo": "tenants",
386
- "columnsFrom": ["tenant_id"],
387
- "columnsTo": ["id"],
386
+ "columnsFrom": [
387
+ "tenant_id"
388
+ ],
389
+ "columnsTo": [
390
+ "id"
391
+ ],
388
392
  "onDelete": "cascade",
389
393
  "onUpdate": "no action"
390
394
  }
@@ -522,6 +526,13 @@
522
526
  "notNull": false,
523
527
  "autoincrement": false
524
528
  },
529
+ "registration_completed_at": {
530
+ "name": "registration_completed_at",
531
+ "type": "text(35)",
532
+ "primaryKey": false,
533
+ "notNull": false,
534
+ "autoincrement": false
535
+ },
525
536
  "provider": {
526
537
  "name": "provider",
527
538
  "type": "text(255)",
@@ -640,37 +651,59 @@
640
651
  "indexes": {
641
652
  "unique_email_provider": {
642
653
  "name": "unique_email_provider",
643
- "columns": ["email", "provider", "tenant_id"],
654
+ "columns": [
655
+ "email",
656
+ "provider",
657
+ "tenant_id"
658
+ ],
644
659
  "isUnique": true
645
660
  },
646
661
  "unique_phone_provider": {
647
662
  "name": "unique_phone_provider",
648
- "columns": ["phone_number", "provider", "tenant_id"],
663
+ "columns": [
664
+ "phone_number",
665
+ "provider",
666
+ "tenant_id"
667
+ ],
649
668
  "isUnique": true
650
669
  },
651
670
  "unique_username_provider": {
652
671
  "name": "unique_username_provider",
653
- "columns": ["username", "provider", "tenant_id"],
672
+ "columns": [
673
+ "username",
674
+ "provider",
675
+ "tenant_id"
676
+ ],
654
677
  "isUnique": true
655
678
  },
656
679
  "users_email_index": {
657
680
  "name": "users_email_index",
658
- "columns": ["email"],
681
+ "columns": [
682
+ "email"
683
+ ],
659
684
  "isUnique": false
660
685
  },
661
686
  "users_linked_to_index": {
662
687
  "name": "users_linked_to_index",
663
- "columns": ["linked_to"],
688
+ "columns": [
689
+ "linked_to"
690
+ ],
664
691
  "isUnique": false
665
692
  },
666
693
  "users_name_index": {
667
694
  "name": "users_name_index",
668
- "columns": ["name"],
695
+ "columns": [
696
+ "name"
697
+ ],
669
698
  "isUnique": false
670
699
  },
671
700
  "users_phone_tenant_provider_index": {
672
701
  "name": "users_phone_tenant_provider_index",
673
- "columns": ["tenant_id", "phone_number", "provider"],
702
+ "columns": [
703
+ "tenant_id",
704
+ "phone_number",
705
+ "provider"
706
+ ],
674
707
  "isUnique": false
675
708
  }
676
709
  },
@@ -679,15 +712,22 @@
679
712
  "name": "users_tenant_id_tenants_id_fk",
680
713
  "tableFrom": "users",
681
714
  "tableTo": "tenants",
682
- "columnsFrom": ["tenant_id"],
683
- "columnsTo": ["id"],
715
+ "columnsFrom": [
716
+ "tenant_id"
717
+ ],
718
+ "columnsTo": [
719
+ "id"
720
+ ],
684
721
  "onDelete": "cascade",
685
722
  "onUpdate": "no action"
686
723
  }
687
724
  },
688
725
  "compositePrimaryKeys": {
689
726
  "users_tenants": {
690
- "columns": ["user_id", "tenant_id"],
727
+ "columns": [
728
+ "user_id",
729
+ "tenant_id"
730
+ ],
691
731
  "name": "users_tenants"
692
732
  }
693
733
  },
@@ -795,8 +835,12 @@
795
835
  "name": "authentication_codes_tenant_id_tenants_id_fk",
796
836
  "tableFrom": "authentication_codes",
797
837
  "tableTo": "tenants",
798
- "columnsFrom": ["tenant_id"],
799
- "columnsTo": ["id"],
838
+ "columnsFrom": [
839
+ "tenant_id"
840
+ ],
841
+ "columnsTo": [
842
+ "id"
843
+ ],
800
844
  "onDelete": "cascade",
801
845
  "onUpdate": "no action"
802
846
  }
@@ -917,7 +961,9 @@
917
961
  "indexes": {
918
962
  "codes_expires_at_index": {
919
963
  "name": "codes_expires_at_index",
920
- "columns": ["expires_at"],
964
+ "columns": [
965
+ "expires_at"
966
+ ],
921
967
  "isUnique": false
922
968
  }
923
969
  },
@@ -926,15 +972,22 @@
926
972
  "name": "codes_tenant_id_tenants_id_fk",
927
973
  "tableFrom": "codes",
928
974
  "tableTo": "tenants",
929
- "columnsFrom": ["tenant_id"],
930
- "columnsTo": ["id"],
975
+ "columnsFrom": [
976
+ "tenant_id"
977
+ ],
978
+ "columnsTo": [
979
+ "id"
980
+ ],
931
981
  "onDelete": "cascade",
932
982
  "onUpdate": "no action"
933
983
  }
934
984
  },
935
985
  "compositePrimaryKeys": {
936
986
  "PK_codes_code_id_code_type": {
937
- "columns": ["code_id", "code_type"],
987
+ "columns": [
988
+ "code_id",
989
+ "code_type"
990
+ ],
938
991
  "name": "PK_codes_code_id_code_type"
939
992
  }
940
993
  },
@@ -972,118 +1025,13 @@
972
1025
  "notNull": true,
973
1026
  "autoincrement": false
974
1027
  },
975
- "authParams_client_id": {
976
- "name": "authParams_client_id",
977
- "type": "text(191)",
978
- "primaryKey": false,
979
- "notNull": true,
980
- "autoincrement": false
981
- },
982
- "authParams_vendor_id": {
983
- "name": "authParams_vendor_id",
984
- "type": "text(255)",
985
- "primaryKey": false,
986
- "notNull": false,
987
- "autoincrement": false
988
- },
989
- "authParams_username": {
990
- "name": "authParams_username",
991
- "type": "text(255)",
992
- "primaryKey": false,
993
- "notNull": false,
994
- "autoincrement": false
995
- },
996
- "authParams_response_type": {
997
- "name": "authParams_response_type",
998
- "type": "text(255)",
999
- "primaryKey": false,
1000
- "notNull": false,
1001
- "autoincrement": false
1002
- },
1003
- "authParams_response_mode": {
1004
- "name": "authParams_response_mode",
1005
- "type": "text(255)",
1006
- "primaryKey": false,
1007
- "notNull": false,
1008
- "autoincrement": false
1009
- },
1010
- "authParams_audience": {
1011
- "name": "authParams_audience",
1012
- "type": "text(255)",
1013
- "primaryKey": false,
1014
- "notNull": false,
1015
- "autoincrement": false
1016
- },
1017
- "authParams_scope": {
1018
- "name": "authParams_scope",
1019
- "type": "text",
1020
- "primaryKey": false,
1021
- "notNull": false,
1022
- "autoincrement": false
1023
- },
1024
- "authParams_state": {
1025
- "name": "authParams_state",
1026
- "type": "text",
1027
- "primaryKey": false,
1028
- "notNull": false,
1029
- "autoincrement": false
1030
- },
1031
- "authParams_nonce": {
1032
- "name": "authParams_nonce",
1033
- "type": "text(255)",
1034
- "primaryKey": false,
1035
- "notNull": false,
1036
- "autoincrement": false
1037
- },
1038
- "authParams_code_challenge_method": {
1039
- "name": "authParams_code_challenge_method",
1040
- "type": "text(255)",
1041
- "primaryKey": false,
1042
- "notNull": false,
1043
- "autoincrement": false
1044
- },
1045
- "authParams_code_challenge": {
1046
- "name": "authParams_code_challenge",
1047
- "type": "text(255)",
1048
- "primaryKey": false,
1049
- "notNull": false,
1050
- "autoincrement": false
1051
- },
1052
- "authParams_redirect_uri": {
1053
- "name": "authParams_redirect_uri",
1028
+ "auth_params": {
1029
+ "name": "auth_params",
1054
1030
  "type": "text",
1055
1031
  "primaryKey": false,
1056
1032
  "notNull": false,
1057
1033
  "autoincrement": false
1058
1034
  },
1059
- "authParams_organization": {
1060
- "name": "authParams_organization",
1061
- "type": "text(255)",
1062
- "primaryKey": false,
1063
- "notNull": false,
1064
- "autoincrement": false
1065
- },
1066
- "authParams_prompt": {
1067
- "name": "authParams_prompt",
1068
- "type": "text(32)",
1069
- "primaryKey": false,
1070
- "notNull": false,
1071
- "autoincrement": false
1072
- },
1073
- "authParams_act_as": {
1074
- "name": "authParams_act_as",
1075
- "type": "text(256)",
1076
- "primaryKey": false,
1077
- "notNull": false,
1078
- "autoincrement": false
1079
- },
1080
- "authParams_ui_locales": {
1081
- "name": "authParams_ui_locales",
1082
- "type": "text(32)",
1083
- "primaryKey": false,
1084
- "notNull": false,
1085
- "autoincrement": false
1086
- },
1087
1035
  "authorization_url": {
1088
1036
  "name": "authorization_url",
1089
1037
  "type": "text",
@@ -1168,32 +1116,65 @@
1168
1116
  "primaryKey": false,
1169
1117
  "notNull": false,
1170
1118
  "autoincrement": false
1119
+ },
1120
+ "auth_strategy_strategy": {
1121
+ "name": "auth_strategy_strategy",
1122
+ "type": "text(64)",
1123
+ "primaryKey": false,
1124
+ "notNull": false,
1125
+ "autoincrement": false
1126
+ },
1127
+ "auth_strategy_strategy_type": {
1128
+ "name": "auth_strategy_strategy_type",
1129
+ "type": "text(64)",
1130
+ "primaryKey": false,
1131
+ "notNull": false,
1132
+ "autoincrement": false
1133
+ },
1134
+ "authenticated_at": {
1135
+ "name": "authenticated_at",
1136
+ "type": "text(35)",
1137
+ "primaryKey": false,
1138
+ "notNull": false,
1139
+ "autoincrement": false
1171
1140
  }
1172
1141
  },
1173
1142
  "indexes": {
1174
1143
  "login_sessions_id_index": {
1175
1144
  "name": "login_sessions_id_index",
1176
- "columns": ["id"],
1145
+ "columns": [
1146
+ "id"
1147
+ ],
1177
1148
  "isUnique": false
1178
1149
  },
1179
1150
  "login_sessions_state_idx": {
1180
1151
  "name": "login_sessions_state_idx",
1181
- "columns": ["state"],
1152
+ "columns": [
1153
+ "state"
1154
+ ],
1182
1155
  "isUnique": false
1183
1156
  },
1184
1157
  "login_sessions_state_updated_idx": {
1185
1158
  "name": "login_sessions_state_updated_idx",
1186
- "columns": ["state", "updated_at_ts"],
1159
+ "columns": [
1160
+ "state",
1161
+ "updated_at_ts"
1162
+ ],
1187
1163
  "isUnique": false
1188
1164
  },
1189
1165
  "login_sessions_tenant_user_idx": {
1190
1166
  "name": "login_sessions_tenant_user_idx",
1191
- "columns": ["tenant_id", "user_id"],
1167
+ "columns": [
1168
+ "tenant_id",
1169
+ "user_id"
1170
+ ],
1192
1171
  "isUnique": false
1193
1172
  },
1194
1173
  "idx_login_sessions_expires_at_ts": {
1195
1174
  "name": "idx_login_sessions_expires_at_ts",
1196
- "columns": ["expires_at_ts"],
1175
+ "columns": [
1176
+ "expires_at_ts"
1177
+ ],
1197
1178
  "isUnique": false
1198
1179
  }
1199
1180
  },
@@ -1202,15 +1183,22 @@
1202
1183
  "name": "login_sessions_tenant_id_tenants_id_fk",
1203
1184
  "tableFrom": "login_sessions",
1204
1185
  "tableTo": "tenants",
1205
- "columnsFrom": ["tenant_id"],
1206
- "columnsTo": ["id"],
1186
+ "columnsFrom": [
1187
+ "tenant_id"
1188
+ ],
1189
+ "columnsTo": [
1190
+ "id"
1191
+ ],
1207
1192
  "onDelete": "cascade",
1208
1193
  "onUpdate": "no action"
1209
1194
  }
1210
1195
  },
1211
1196
  "compositePrimaryKeys": {
1212
1197
  "login_sessions_pk": {
1213
- "columns": ["tenant_id", "id"],
1198
+ "columns": [
1199
+ "tenant_id",
1200
+ "id"
1201
+ ],
1214
1202
  "name": "login_sessions_pk"
1215
1203
  }
1216
1204
  },
@@ -1350,12 +1338,16 @@
1350
1338
  "indexes": {
1351
1339
  "otps_email_index": {
1352
1340
  "name": "otps_email_index",
1353
- "columns": ["email"],
1341
+ "columns": [
1342
+ "email"
1343
+ ],
1354
1344
  "isUnique": false
1355
1345
  },
1356
1346
  "otps_expires_at_index": {
1357
1347
  "name": "otps_expires_at_index",
1358
- "columns": ["expires_at"],
1348
+ "columns": [
1349
+ "expires_at"
1350
+ ],
1359
1351
  "isUnique": false
1360
1352
  }
1361
1353
  },
@@ -1364,8 +1356,12 @@
1364
1356
  "name": "otps_tenant_id_tenants_id_fk",
1365
1357
  "tableFrom": "otps",
1366
1358
  "tableTo": "tenants",
1367
- "columnsFrom": ["tenant_id"],
1368
- "columnsTo": ["id"],
1359
+ "columnsFrom": [
1360
+ "tenant_id"
1361
+ ],
1362
+ "columnsTo": [
1363
+ "id"
1364
+ ],
1369
1365
  "onDelete": "cascade",
1370
1366
  "onUpdate": "no action"
1371
1367
  }
@@ -1465,17 +1461,24 @@
1465
1461
  "indexes": {
1466
1462
  "idx_refresh_tokens_user_id": {
1467
1463
  "name": "idx_refresh_tokens_user_id",
1468
- "columns": ["tenant_id", "user_id"],
1464
+ "columns": [
1465
+ "tenant_id",
1466
+ "user_id"
1467
+ ],
1469
1468
  "isUnique": false
1470
1469
  },
1471
1470
  "idx_refresh_tokens_login_id": {
1472
1471
  "name": "idx_refresh_tokens_login_id",
1473
- "columns": ["login_id"],
1472
+ "columns": [
1473
+ "login_id"
1474
+ ],
1474
1475
  "isUnique": false
1475
1476
  },
1476
1477
  "idx_refresh_tokens_expires_at_ts": {
1477
1478
  "name": "idx_refresh_tokens_expires_at_ts",
1478
- "columns": ["expires_at_ts"],
1479
+ "columns": [
1480
+ "expires_at_ts"
1481
+ ],
1479
1482
  "isUnique": false
1480
1483
  }
1481
1484
  },
@@ -1484,15 +1487,22 @@
1484
1487
  "name": "refresh_tokens_tenant_id_tenants_id_fk",
1485
1488
  "tableFrom": "refresh_tokens",
1486
1489
  "tableTo": "tenants",
1487
- "columnsFrom": ["tenant_id"],
1488
- "columnsTo": ["id"],
1490
+ "columnsFrom": [
1491
+ "tenant_id"
1492
+ ],
1493
+ "columnsTo": [
1494
+ "id"
1495
+ ],
1489
1496
  "onDelete": "cascade",
1490
1497
  "onUpdate": "no action"
1491
1498
  }
1492
1499
  },
1493
1500
  "compositePrimaryKeys": {
1494
1501
  "refresh_tokens_pk": {
1495
- "columns": ["tenant_id", "id"],
1502
+ "columns": [
1503
+ "tenant_id",
1504
+ "id"
1505
+ ],
1496
1506
  "name": "refresh_tokens_pk"
1497
1507
  }
1498
1508
  },
@@ -1604,17 +1614,24 @@
1604
1614
  "indexes": {
1605
1615
  "IDX_sessions_login_session_id": {
1606
1616
  "name": "IDX_sessions_login_session_id",
1607
- "columns": ["login_session_id"],
1617
+ "columns": [
1618
+ "login_session_id"
1619
+ ],
1608
1620
  "isUnique": false
1609
1621
  },
1610
1622
  "idx_sessions_user_id": {
1611
1623
  "name": "idx_sessions_user_id",
1612
- "columns": ["tenant_id", "user_id"],
1624
+ "columns": [
1625
+ "tenant_id",
1626
+ "user_id"
1627
+ ],
1613
1628
  "isUnique": false
1614
1629
  },
1615
1630
  "idx_sessions_expires_at_ts": {
1616
1631
  "name": "idx_sessions_expires_at_ts",
1617
- "columns": ["expires_at_ts"],
1632
+ "columns": [
1633
+ "expires_at_ts"
1634
+ ],
1618
1635
  "isUnique": false
1619
1636
  }
1620
1637
  },
@@ -1623,15 +1640,22 @@
1623
1640
  "name": "sessions_tenant_id_tenants_id_fk",
1624
1641
  "tableFrom": "sessions",
1625
1642
  "tableTo": "tenants",
1626
- "columnsFrom": ["tenant_id"],
1627
- "columnsTo": ["id"],
1643
+ "columnsFrom": [
1644
+ "tenant_id"
1645
+ ],
1646
+ "columnsTo": [
1647
+ "id"
1648
+ ],
1628
1649
  "onDelete": "cascade",
1629
1650
  "onUpdate": "no action"
1630
1651
  }
1631
1652
  },
1632
1653
  "compositePrimaryKeys": {
1633
1654
  "sessions_pk": {
1634
- "columns": ["tenant_id", "id"],
1655
+ "columns": [
1656
+ "tenant_id",
1657
+ "id"
1658
+ ],
1635
1659
  "name": "sessions_pk"
1636
1660
  }
1637
1661
  },
@@ -1739,8 +1763,12 @@
1739
1763
  "name": "tickets_tenant_id_tenants_id_fk",
1740
1764
  "tableFrom": "tickets",
1741
1765
  "tableTo": "tenants",
1742
- "columnsFrom": ["tenant_id"],
1743
- "columnsTo": ["id"],
1766
+ "columnsFrom": [
1767
+ "tenant_id"
1768
+ ],
1769
+ "columnsTo": [
1770
+ "id"
1771
+ ],
1744
1772
  "onDelete": "cascade",
1745
1773
  "onUpdate": "no action"
1746
1774
  }
@@ -1844,7 +1872,9 @@
1844
1872
  "indexes": {
1845
1873
  "idx_client_grants_audience": {
1846
1874
  "name": "idx_client_grants_audience",
1847
- "columns": ["audience"],
1875
+ "columns": [
1876
+ "audience"
1877
+ ],
1848
1878
  "isUnique": false
1849
1879
  }
1850
1880
  },
@@ -1853,15 +1883,22 @@
1853
1883
  "name": "client_grants_tenant_id_tenants_id_fk",
1854
1884
  "tableFrom": "client_grants",
1855
1885
  "tableTo": "tenants",
1856
- "columnsFrom": ["tenant_id"],
1857
- "columnsTo": ["id"],
1886
+ "columnsFrom": [
1887
+ "tenant_id"
1888
+ ],
1889
+ "columnsTo": [
1890
+ "id"
1891
+ ],
1858
1892
  "onDelete": "cascade",
1859
1893
  "onUpdate": "no action"
1860
1894
  }
1861
1895
  },
1862
1896
  "compositePrimaryKeys": {
1863
1897
  "pk_client_grants": {
1864
- "columns": ["tenant_id", "id"],
1898
+ "columns": [
1899
+ "tenant_id",
1900
+ "id"
1901
+ ],
1865
1902
  "name": "pk_client_grants"
1866
1903
  }
1867
1904
  },
@@ -2250,15 +2287,22 @@
2250
2287
  "name": "clients_tenant_id_tenants_id_fk",
2251
2288
  "tableFrom": "clients",
2252
2289
  "tableTo": "tenants",
2253
- "columnsFrom": ["tenant_id"],
2254
- "columnsTo": ["id"],
2290
+ "columnsFrom": [
2291
+ "tenant_id"
2292
+ ],
2293
+ "columnsTo": [
2294
+ "id"
2295
+ ],
2255
2296
  "onDelete": "cascade",
2256
2297
  "onUpdate": "no action"
2257
2298
  }
2258
2299
  },
2259
2300
  "compositePrimaryKeys": {
2260
2301
  "clients_tenant_id_client_id": {
2261
- "columns": ["tenant_id", "client_id"],
2302
+ "columns": [
2303
+ "tenant_id",
2304
+ "client_id"
2305
+ ],
2262
2306
  "name": "clients_tenant_id_client_id"
2263
2307
  }
2264
2308
  },
@@ -2372,12 +2416,16 @@
2372
2416
  "indexes": {
2373
2417
  "connections_tenant_id_index": {
2374
2418
  "name": "connections_tenant_id_index",
2375
- "columns": ["tenant_id"],
2419
+ "columns": [
2420
+ "tenant_id"
2421
+ ],
2376
2422
  "isUnique": false
2377
2423
  },
2378
2424
  "connections_id_unique": {
2379
2425
  "name": "connections_id_unique",
2380
- "columns": ["id"],
2426
+ "columns": [
2427
+ "id"
2428
+ ],
2381
2429
  "isUnique": true
2382
2430
  }
2383
2431
  },
@@ -2386,15 +2434,22 @@
2386
2434
  "name": "connections_tenant_id_tenants_id_fk",
2387
2435
  "tableFrom": "connections",
2388
2436
  "tableTo": "tenants",
2389
- "columnsFrom": ["tenant_id"],
2390
- "columnsTo": ["id"],
2437
+ "columnsFrom": [
2438
+ "tenant_id"
2439
+ ],
2440
+ "columnsTo": [
2441
+ "id"
2442
+ ],
2391
2443
  "onDelete": "cascade",
2392
2444
  "onUpdate": "no action"
2393
2445
  }
2394
2446
  },
2395
2447
  "compositePrimaryKeys": {
2396
2448
  "connections_tenant_id_id_pk": {
2397
- "columns": ["tenant_id", "id"],
2449
+ "columns": [
2450
+ "tenant_id",
2451
+ "id"
2452
+ ],
2398
2453
  "name": "connections_tenant_id_id_pk"
2399
2454
  }
2400
2455
  },
@@ -2496,14 +2551,26 @@
2496
2551
  "autoincrement": false
2497
2552
  }
2498
2553
  },
2499
- "indexes": {},
2554
+ "indexes": {
2555
+ "custom_domains_domain_unique": {
2556
+ "name": "custom_domains_domain_unique",
2557
+ "columns": [
2558
+ "domain"
2559
+ ],
2560
+ "isUnique": true
2561
+ }
2562
+ },
2500
2563
  "foreignKeys": {
2501
2564
  "custom_domains_tenant_id_tenants_id_fk": {
2502
2565
  "name": "custom_domains_tenant_id_tenants_id_fk",
2503
2566
  "tableFrom": "custom_domains",
2504
2567
  "tableTo": "tenants",
2505
- "columnsFrom": ["tenant_id"],
2506
- "columnsTo": ["id"],
2568
+ "columnsFrom": [
2569
+ "tenant_id"
2570
+ ],
2571
+ "columnsTo": [
2572
+ "id"
2573
+ ],
2507
2574
  "onDelete": "cascade",
2508
2575
  "onUpdate": "no action"
2509
2576
  }
@@ -2585,8 +2652,12 @@
2585
2652
  "name": "domains_tenant_id_tenants_id_fk",
2586
2653
  "tableFrom": "domains",
2587
2654
  "tableTo": "tenants",
2588
- "columnsFrom": ["tenant_id"],
2589
- "columnsTo": ["id"],
2655
+ "columnsFrom": [
2656
+ "tenant_id"
2657
+ ],
2658
+ "columnsTo": [
2659
+ "id"
2660
+ ],
2590
2661
  "onDelete": "cascade",
2591
2662
  "onUpdate": "no action"
2592
2663
  }
@@ -2714,22 +2785,31 @@
2714
2785
  "indexes": {
2715
2786
  "idx_invites_tenant_id": {
2716
2787
  "name": "idx_invites_tenant_id",
2717
- "columns": ["tenant_id"],
2788
+ "columns": [
2789
+ "tenant_id"
2790
+ ],
2718
2791
  "isUnique": false
2719
2792
  },
2720
2793
  "idx_invites_organization_id": {
2721
2794
  "name": "idx_invites_organization_id",
2722
- "columns": ["organization_id"],
2795
+ "columns": [
2796
+ "organization_id"
2797
+ ],
2723
2798
  "isUnique": false
2724
2799
  },
2725
2800
  "idx_invites_expires_at": {
2726
2801
  "name": "idx_invites_expires_at",
2727
- "columns": ["expires_at"],
2802
+ "columns": [
2803
+ "expires_at"
2804
+ ],
2728
2805
  "isUnique": false
2729
2806
  },
2730
2807
  "idx_invites_tenant_created": {
2731
2808
  "name": "idx_invites_tenant_created",
2732
- "columns": ["tenant_id", "created_at"],
2809
+ "columns": [
2810
+ "tenant_id",
2811
+ "created_at"
2812
+ ],
2733
2813
  "isUnique": false
2734
2814
  }
2735
2815
  },
@@ -2815,7 +2895,9 @@
2815
2895
  "indexes": {
2816
2896
  "idx_organizations_tenant_id": {
2817
2897
  "name": "idx_organizations_tenant_id",
2818
- "columns": ["tenant_id"],
2898
+ "columns": [
2899
+ "tenant_id"
2900
+ ],
2819
2901
  "isUnique": false
2820
2902
  }
2821
2903
  },
@@ -2873,22 +2955,32 @@
2873
2955
  "indexes": {
2874
2956
  "user_organizations_unique": {
2875
2957
  "name": "user_organizations_unique",
2876
- "columns": ["tenant_id", "user_id", "organization_id"],
2958
+ "columns": [
2959
+ "tenant_id",
2960
+ "user_id",
2961
+ "organization_id"
2962
+ ],
2877
2963
  "isUnique": true
2878
2964
  },
2879
2965
  "idx_user_organizations_tenant_id": {
2880
2966
  "name": "idx_user_organizations_tenant_id",
2881
- "columns": ["tenant_id"],
2967
+ "columns": [
2968
+ "tenant_id"
2969
+ ],
2882
2970
  "isUnique": false
2883
2971
  },
2884
2972
  "idx_user_organizations_user_id": {
2885
2973
  "name": "idx_user_organizations_user_id",
2886
- "columns": ["user_id"],
2974
+ "columns": [
2975
+ "user_id"
2976
+ ],
2887
2977
  "isUnique": false
2888
2978
  },
2889
2979
  "idx_user_organizations_organization_id": {
2890
2980
  "name": "idx_user_organizations_organization_id",
2891
- "columns": ["organization_id"],
2981
+ "columns": [
2982
+ "organization_id"
2983
+ ],
2892
2984
  "isUnique": false
2893
2985
  }
2894
2986
  },
@@ -3025,7 +3117,10 @@
3025
3117
  "foreignKeys": {},
3026
3118
  "compositePrimaryKeys": {
3027
3119
  "resource_servers_pk": {
3028
- "columns": ["tenant_id", "id"],
3120
+ "columns": [
3121
+ "tenant_id",
3122
+ "id"
3123
+ ],
3029
3124
  "name": "resource_servers_pk"
3030
3125
  }
3031
3126
  },
@@ -3074,7 +3169,10 @@
3074
3169
  "indexes": {
3075
3170
  "role_permissions_role_fk": {
3076
3171
  "name": "role_permissions_role_fk",
3077
- "columns": ["tenant_id", "role_id"],
3172
+ "columns": [
3173
+ "tenant_id",
3174
+ "role_id"
3175
+ ],
3078
3176
  "isUnique": false
3079
3177
  },
3080
3178
  "role_permissions_permission_fk": {
@@ -3167,7 +3265,10 @@
3167
3265
  "foreignKeys": {},
3168
3266
  "compositePrimaryKeys": {
3169
3267
  "roles_pk": {
3170
- "columns": ["tenant_id", "id"],
3268
+ "columns": [
3269
+ "tenant_id",
3270
+ "id"
3271
+ ],
3171
3272
  "name": "roles_pk"
3172
3273
  }
3173
3274
  },
@@ -3224,7 +3325,10 @@
3224
3325
  "indexes": {
3225
3326
  "user_permissions_user_fk": {
3226
3327
  "name": "user_permissions_user_fk",
3227
- "columns": ["tenant_id", "user_id"],
3328
+ "columns": [
3329
+ "tenant_id",
3330
+ "user_id"
3331
+ ],
3228
3332
  "isUnique": false
3229
3333
  },
3230
3334
  "user_permissions_permission_fk": {
@@ -3238,7 +3342,9 @@
3238
3342
  },
3239
3343
  "user_permissions_organization_fk": {
3240
3344
  "name": "user_permissions_organization_fk",
3241
- "columns": ["organization_id"],
3345
+ "columns": [
3346
+ "organization_id"
3347
+ ],
3242
3348
  "isUnique": false
3243
3349
  }
3244
3350
  },
@@ -3301,24 +3407,37 @@
3301
3407
  "indexes": {
3302
3408
  "user_roles_user_fk": {
3303
3409
  "name": "user_roles_user_fk",
3304
- "columns": ["tenant_id", "user_id"],
3410
+ "columns": [
3411
+ "tenant_id",
3412
+ "user_id"
3413
+ ],
3305
3414
  "isUnique": false
3306
3415
  },
3307
3416
  "user_roles_role_fk": {
3308
3417
  "name": "user_roles_role_fk",
3309
- "columns": ["tenant_id", "role_id"],
3418
+ "columns": [
3419
+ "tenant_id",
3420
+ "role_id"
3421
+ ],
3310
3422
  "isUnique": false
3311
3423
  },
3312
3424
  "user_roles_organization_fk": {
3313
3425
  "name": "user_roles_organization_fk",
3314
- "columns": ["organization_id"],
3426
+ "columns": [
3427
+ "organization_id"
3428
+ ],
3315
3429
  "isUnique": false
3316
3430
  }
3317
3431
  },
3318
3432
  "foreignKeys": {},
3319
3433
  "compositePrimaryKeys": {
3320
3434
  "user_roles_pk": {
3321
- "columns": ["tenant_id", "user_id", "role_id", "organization_id"],
3435
+ "columns": [
3436
+ "tenant_id",
3437
+ "user_id",
3438
+ "role_id",
3439
+ "organization_id"
3440
+ ],
3322
3441
  "name": "user_roles_pk"
3323
3442
  }
3324
3443
  },
@@ -3398,8 +3517,12 @@
3398
3517
  "name": "branding_tenant_id_tenants_id_fk",
3399
3518
  "tableFrom": "branding",
3400
3519
  "tableTo": "tenants",
3401
- "columnsFrom": ["tenant_id"],
3402
- "columnsTo": ["id"],
3520
+ "columnsFrom": [
3521
+ "tenant_id"
3522
+ ],
3523
+ "columnsTo": [
3524
+ "id"
3525
+ ],
3403
3526
  "onDelete": "cascade",
3404
3527
  "onUpdate": "no action"
3405
3528
  }
@@ -3460,15 +3583,23 @@
3460
3583
  "name": "custom_text_tenant_id_tenants_id_fk",
3461
3584
  "tableFrom": "custom_text",
3462
3585
  "tableTo": "tenants",
3463
- "columnsFrom": ["tenant_id"],
3464
- "columnsTo": ["id"],
3586
+ "columnsFrom": [
3587
+ "tenant_id"
3588
+ ],
3589
+ "columnsTo": [
3590
+ "id"
3591
+ ],
3465
3592
  "onDelete": "cascade",
3466
3593
  "onUpdate": "no action"
3467
3594
  }
3468
3595
  },
3469
3596
  "compositePrimaryKeys": {
3470
3597
  "custom_text_tenant_id_prompt_language_pk": {
3471
- "columns": ["tenant_id", "prompt", "language"],
3598
+ "columns": [
3599
+ "tenant_id",
3600
+ "prompt",
3601
+ "language"
3602
+ ],
3472
3603
  "name": "custom_text_tenant_id_prompt_language_pk"
3473
3604
  }
3474
3605
  },
@@ -3592,7 +3723,9 @@
3592
3723
  "indexes": {
3593
3724
  "flows_tenant_id_idx": {
3594
3725
  "name": "flows_tenant_id_idx",
3595
- "columns": ["tenant_id"],
3726
+ "columns": [
3727
+ "tenant_id"
3728
+ ],
3596
3729
  "isUnique": false
3597
3730
  }
3598
3731
  },
@@ -3601,8 +3734,12 @@
3601
3734
  "name": "flows_tenant_id_tenants_id_fk",
3602
3735
  "tableFrom": "flows",
3603
3736
  "tableTo": "tenants",
3604
- "columnsFrom": ["tenant_id"],
3605
- "columnsTo": ["id"],
3737
+ "columnsFrom": [
3738
+ "tenant_id"
3739
+ ],
3740
+ "columnsTo": [
3741
+ "id"
3742
+ ],
3606
3743
  "onDelete": "cascade",
3607
3744
  "onUpdate": "no action"
3608
3745
  }
@@ -3702,7 +3839,9 @@
3702
3839
  "indexes": {
3703
3840
  "forms_tenant_id_idx": {
3704
3841
  "name": "forms_tenant_id_idx",
3705
- "columns": ["tenant_id"],
3842
+ "columns": [
3843
+ "tenant_id"
3844
+ ],
3706
3845
  "isUnique": false
3707
3846
  }
3708
3847
  },
@@ -3711,8 +3850,86 @@
3711
3850
  "name": "forms_tenant_id_tenants_id_fk",
3712
3851
  "tableFrom": "forms",
3713
3852
  "tableTo": "tenants",
3714
- "columnsFrom": ["tenant_id"],
3715
- "columnsTo": ["id"],
3853
+ "columnsFrom": [
3854
+ "tenant_id"
3855
+ ],
3856
+ "columnsTo": [
3857
+ "id"
3858
+ ],
3859
+ "onDelete": "cascade",
3860
+ "onUpdate": "no action"
3861
+ }
3862
+ },
3863
+ "compositePrimaryKeys": {},
3864
+ "uniqueConstraints": {},
3865
+ "checkConstraints": {}
3866
+ },
3867
+ "hook_code": {
3868
+ "name": "hook_code",
3869
+ "columns": {
3870
+ "id": {
3871
+ "name": "id",
3872
+ "type": "text(21)",
3873
+ "primaryKey": true,
3874
+ "notNull": true,
3875
+ "autoincrement": false
3876
+ },
3877
+ "tenant_id": {
3878
+ "name": "tenant_id",
3879
+ "type": "text(191)",
3880
+ "primaryKey": false,
3881
+ "notNull": true,
3882
+ "autoincrement": false
3883
+ },
3884
+ "code": {
3885
+ "name": "code",
3886
+ "type": "text",
3887
+ "primaryKey": false,
3888
+ "notNull": true,
3889
+ "autoincrement": false
3890
+ },
3891
+ "secrets": {
3892
+ "name": "secrets",
3893
+ "type": "text",
3894
+ "primaryKey": false,
3895
+ "notNull": false,
3896
+ "autoincrement": false
3897
+ },
3898
+ "created_at_ts": {
3899
+ "name": "created_at_ts",
3900
+ "type": "integer",
3901
+ "primaryKey": false,
3902
+ "notNull": true,
3903
+ "autoincrement": false
3904
+ },
3905
+ "updated_at_ts": {
3906
+ "name": "updated_at_ts",
3907
+ "type": "integer",
3908
+ "primaryKey": false,
3909
+ "notNull": true,
3910
+ "autoincrement": false
3911
+ }
3912
+ },
3913
+ "indexes": {
3914
+ "hook_code_tenant_id_idx": {
3915
+ "name": "hook_code_tenant_id_idx",
3916
+ "columns": [
3917
+ "tenant_id"
3918
+ ],
3919
+ "isUnique": false
3920
+ }
3921
+ },
3922
+ "foreignKeys": {
3923
+ "hook_code_tenant_id_tenants_id_fk": {
3924
+ "name": "hook_code_tenant_id_tenants_id_fk",
3925
+ "tableFrom": "hook_code",
3926
+ "tableTo": "tenants",
3927
+ "columnsFrom": [
3928
+ "tenant_id"
3929
+ ],
3930
+ "columnsTo": [
3931
+ "id"
3932
+ ],
3716
3933
  "onDelete": "cascade",
3717
3934
  "onUpdate": "no action"
3718
3935
  }
@@ -3801,16 +4018,35 @@
3801
4018
  "primaryKey": false,
3802
4019
  "notNull": false,
3803
4020
  "autoincrement": false
4021
+ },
4022
+ "code_id": {
4023
+ "name": "code_id",
4024
+ "type": "text(21)",
4025
+ "primaryKey": false,
4026
+ "notNull": false,
4027
+ "autoincrement": false
4028
+ }
4029
+ },
4030
+ "indexes": {
4031
+ "hooks_tenant_id_idx": {
4032
+ "name": "hooks_tenant_id_idx",
4033
+ "columns": [
4034
+ "tenant_id"
4035
+ ],
4036
+ "isUnique": false
3804
4037
  }
3805
4038
  },
3806
- "indexes": {},
3807
4039
  "foreignKeys": {
3808
4040
  "hooks_tenant_id_tenants_id_fk": {
3809
4041
  "name": "hooks_tenant_id_tenants_id_fk",
3810
4042
  "tableFrom": "hooks",
3811
4043
  "tableTo": "tenants",
3812
- "columnsFrom": ["tenant_id"],
3813
- "columnsTo": ["id"],
4044
+ "columnsFrom": [
4045
+ "tenant_id"
4046
+ ],
4047
+ "columnsTo": [
4048
+ "id"
4049
+ ],
3814
4050
  "onDelete": "cascade",
3815
4051
  "onUpdate": "no action"
3816
4052
  }
@@ -3914,8 +4150,12 @@
3914
4150
  "name": "keys_tenant_id_tenants_id_fk",
3915
4151
  "tableFrom": "keys",
3916
4152
  "tableTo": "tenants",
3917
- "columnsFrom": ["tenant_id"],
3918
- "columnsTo": ["id"],
4153
+ "columnsFrom": [
4154
+ "tenant_id"
4155
+ ],
4156
+ "columnsTo": [
4157
+ "id"
4158
+ ],
3919
4159
  "onDelete": "cascade",
3920
4160
  "onUpdate": "no action"
3921
4161
  },
@@ -3923,8 +4163,12 @@
3923
4163
  "name": "keys_connection_connections_id_fk",
3924
4164
  "tableFrom": "keys",
3925
4165
  "tableTo": "connections",
3926
- "columnsFrom": ["connection"],
3927
- "columnsTo": ["id"],
4166
+ "columnsFrom": [
4167
+ "connection"
4168
+ ],
4169
+ "columnsTo": [
4170
+ "id"
4171
+ ],
3928
4172
  "onDelete": "cascade",
3929
4173
  "onUpdate": "no action"
3930
4174
  }
@@ -4381,7 +4625,9 @@
4381
4625
  "indexes": {
4382
4626
  "themes_tenant_id_idx": {
4383
4627
  "name": "themes_tenant_id_idx",
4384
- "columns": ["tenant_id"],
4628
+ "columns": [
4629
+ "tenant_id"
4630
+ ],
4385
4631
  "isUnique": false
4386
4632
  }
4387
4633
  },
@@ -4390,15 +4636,22 @@
4390
4636
  "name": "themes_tenant_id_tenants_id_fk",
4391
4637
  "tableFrom": "themes",
4392
4638
  "tableTo": "tenants",
4393
- "columnsFrom": ["tenant_id"],
4394
- "columnsTo": ["id"],
4639
+ "columnsFrom": [
4640
+ "tenant_id"
4641
+ ],
4642
+ "columnsTo": [
4643
+ "id"
4644
+ ],
4395
4645
  "onDelete": "cascade",
4396
4646
  "onUpdate": "no action"
4397
4647
  }
4398
4648
  },
4399
4649
  "compositePrimaryKeys": {
4400
4650
  "themes_pkey": {
4401
- "columns": ["tenant_id", "themeId"],
4651
+ "columns": [
4652
+ "tenant_id",
4653
+ "themeId"
4654
+ ],
4402
4655
  "name": "themes_pkey"
4403
4656
  }
4404
4657
  },
@@ -4443,8 +4696,12 @@
4443
4696
  "name": "universal_login_templates_tenant_id_tenants_id_fk",
4444
4697
  "tableFrom": "universal_login_templates",
4445
4698
  "tableTo": "tenants",
4446
- "columnsFrom": ["tenant_id"],
4447
- "columnsTo": ["id"],
4699
+ "columnsFrom": [
4700
+ "tenant_id"
4701
+ ],
4702
+ "columnsTo": [
4703
+ "id"
4704
+ ],
4448
4705
  "onDelete": "cascade",
4449
4706
  "onUpdate": "no action"
4450
4707
  }
@@ -4566,12 +4823,17 @@
4566
4823
  "indexes": {
4567
4824
  "authentication_methods_tenant_user_idx": {
4568
4825
  "name": "authentication_methods_tenant_user_idx",
4569
- "columns": ["tenant_id", "user_id"],
4826
+ "columns": [
4827
+ "tenant_id",
4828
+ "user_id"
4829
+ ],
4570
4830
  "isUnique": false
4571
4831
  },
4572
4832
  "authentication_methods_credential_id_idx": {
4573
4833
  "name": "authentication_methods_credential_id_idx",
4574
- "columns": ["credential_id"],
4834
+ "columns": [
4835
+ "credential_id"
4836
+ ],
4575
4837
  "isUnique": false
4576
4838
  }
4577
4839
  },
@@ -4580,8 +4842,12 @@
4580
4842
  "name": "authentication_methods_tenant_id_tenants_id_fk",
4581
4843
  "tableFrom": "authentication_methods",
4582
4844
  "tableTo": "tenants",
4583
- "columnsFrom": ["tenant_id"],
4584
- "columnsTo": ["id"],
4845
+ "columnsFrom": [
4846
+ "tenant_id"
4847
+ ],
4848
+ "columnsTo": [
4849
+ "id"
4850
+ ],
4585
4851
  "onDelete": "cascade",
4586
4852
  "onUpdate": "no action"
4587
4853
  }
@@ -4800,22 +5066,33 @@
4800
5066
  "indexes": {
4801
5067
  "logs_user_id": {
4802
5068
  "name": "logs_user_id",
4803
- "columns": ["user_id"],
5069
+ "columns": [
5070
+ "user_id"
5071
+ ],
4804
5072
  "isUnique": false
4805
5073
  },
4806
5074
  "logs_tenant_id": {
4807
5075
  "name": "logs_tenant_id",
4808
- "columns": ["tenant_id"],
5076
+ "columns": [
5077
+ "tenant_id"
5078
+ ],
4809
5079
  "isUnique": false
4810
5080
  },
4811
5081
  "logs_date": {
4812
5082
  "name": "logs_date",
4813
- "columns": ["date"],
5083
+ "columns": [
5084
+ "date"
5085
+ ],
4814
5086
  "isUnique": false
4815
5087
  },
4816
5088
  "IDX_logs_tenant_date_type_user": {
4817
5089
  "name": "IDX_logs_tenant_date_type_user",
4818
- "columns": ["tenant_id", "date", "type", "user_id"],
5090
+ "columns": [
5091
+ "tenant_id",
5092
+ "date",
5093
+ "type",
5094
+ "user_id"
5095
+ ],
4819
5096
  "isUnique": false
4820
5097
  }
4821
5098
  },
@@ -4925,22 +5202,50 @@
4925
5202
  "primaryKey": false,
4926
5203
  "notNull": false,
4927
5204
  "autoincrement": false
5205
+ },
5206
+ "dead_lettered_at": {
5207
+ "name": "dead_lettered_at",
5208
+ "type": "text(35)",
5209
+ "primaryKey": false,
5210
+ "notNull": false,
5211
+ "autoincrement": false
5212
+ },
5213
+ "final_error": {
5214
+ "name": "final_error",
5215
+ "type": "text",
5216
+ "primaryKey": false,
5217
+ "notNull": false,
5218
+ "autoincrement": false
4928
5219
  }
4929
5220
  },
4930
5221
  "indexes": {
4931
5222
  "idx_outbox_events_tenant_id": {
4932
5223
  "name": "idx_outbox_events_tenant_id",
4933
- "columns": ["tenant_id"],
5224
+ "columns": [
5225
+ "tenant_id"
5226
+ ],
4934
5227
  "isUnique": false
4935
5228
  },
4936
5229
  "idx_outbox_events_processed_at": {
4937
5230
  "name": "idx_outbox_events_processed_at",
4938
- "columns": ["processed_at"],
5231
+ "columns": [
5232
+ "processed_at"
5233
+ ],
4939
5234
  "isUnique": false
4940
5235
  },
4941
5236
  "idx_outbox_events_claimed_by": {
4942
5237
  "name": "idx_outbox_events_claimed_by",
4943
- "columns": ["claimed_by"],
5238
+ "columns": [
5239
+ "claimed_by"
5240
+ ],
5241
+ "isUnique": false
5242
+ },
5243
+ "idx_outbox_events_tenant_dead_lettered": {
5244
+ "name": "idx_outbox_events_tenant_dead_lettered",
5245
+ "columns": [
5246
+ "tenant_id",
5247
+ "dead_lettered_at"
5248
+ ],
4944
5249
  "isUnique": false
4945
5250
  }
4946
5251
  },
@@ -4949,8 +5254,12 @@
4949
5254
  "name": "outbox_events_tenant_id_tenants_id_fk",
4950
5255
  "tableFrom": "outbox_events",
4951
5256
  "tableTo": "tenants",
4952
- "columnsFrom": ["tenant_id"],
4953
- "columnsTo": ["id"],
5257
+ "columnsFrom": [
5258
+ "tenant_id"
5259
+ ],
5260
+ "columnsTo": [
5261
+ "id"
5262
+ ],
4954
5263
  "onDelete": "cascade",
4955
5264
  "onUpdate": "no action"
4956
5265
  }
@@ -4970,4 +5279,4 @@
4970
5279
  "internal": {
4971
5280
  "indexes": {}
4972
5281
  }
4973
- }
5282
+ }