@authhero/drizzle 0.39.0 → 0.41.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",
1028
+ "auth_params": {
1029
+ "name": "auth_params",
1019
1030
  "type": "text",
1020
1031
  "primaryKey": false,
1021
1032
  "notNull": false,
1022
1033
  "autoincrement": false
1023
1034
  },
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",
1054
- "type": "text",
1055
- "primaryKey": false,
1056
- "notNull": false,
1057
- "autoincrement": false
1058
- },
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
  }
@@ -1460,22 +1456,36 @@
1460
1456
  "primaryKey": false,
1461
1457
  "notNull": false,
1462
1458
  "autoincrement": false
1459
+ },
1460
+ "revoked_at_ts": {
1461
+ "name": "revoked_at_ts",
1462
+ "type": "integer",
1463
+ "primaryKey": false,
1464
+ "notNull": false,
1465
+ "autoincrement": false
1463
1466
  }
1464
1467
  },
1465
1468
  "indexes": {
1466
1469
  "idx_refresh_tokens_user_id": {
1467
1470
  "name": "idx_refresh_tokens_user_id",
1468
- "columns": ["tenant_id", "user_id"],
1471
+ "columns": [
1472
+ "tenant_id",
1473
+ "user_id"
1474
+ ],
1469
1475
  "isUnique": false
1470
1476
  },
1471
1477
  "idx_refresh_tokens_login_id": {
1472
1478
  "name": "idx_refresh_tokens_login_id",
1473
- "columns": ["login_id"],
1479
+ "columns": [
1480
+ "login_id"
1481
+ ],
1474
1482
  "isUnique": false
1475
1483
  },
1476
1484
  "idx_refresh_tokens_expires_at_ts": {
1477
1485
  "name": "idx_refresh_tokens_expires_at_ts",
1478
- "columns": ["expires_at_ts"],
1486
+ "columns": [
1487
+ "expires_at_ts"
1488
+ ],
1479
1489
  "isUnique": false
1480
1490
  }
1481
1491
  },
@@ -1484,15 +1494,22 @@
1484
1494
  "name": "refresh_tokens_tenant_id_tenants_id_fk",
1485
1495
  "tableFrom": "refresh_tokens",
1486
1496
  "tableTo": "tenants",
1487
- "columnsFrom": ["tenant_id"],
1488
- "columnsTo": ["id"],
1497
+ "columnsFrom": [
1498
+ "tenant_id"
1499
+ ],
1500
+ "columnsTo": [
1501
+ "id"
1502
+ ],
1489
1503
  "onDelete": "cascade",
1490
1504
  "onUpdate": "no action"
1491
1505
  }
1492
1506
  },
1493
1507
  "compositePrimaryKeys": {
1494
1508
  "refresh_tokens_pk": {
1495
- "columns": ["tenant_id", "id"],
1509
+ "columns": [
1510
+ "tenant_id",
1511
+ "id"
1512
+ ],
1496
1513
  "name": "refresh_tokens_pk"
1497
1514
  }
1498
1515
  },
@@ -1604,17 +1621,24 @@
1604
1621
  "indexes": {
1605
1622
  "IDX_sessions_login_session_id": {
1606
1623
  "name": "IDX_sessions_login_session_id",
1607
- "columns": ["login_session_id"],
1624
+ "columns": [
1625
+ "login_session_id"
1626
+ ],
1608
1627
  "isUnique": false
1609
1628
  },
1610
1629
  "idx_sessions_user_id": {
1611
1630
  "name": "idx_sessions_user_id",
1612
- "columns": ["tenant_id", "user_id"],
1631
+ "columns": [
1632
+ "tenant_id",
1633
+ "user_id"
1634
+ ],
1613
1635
  "isUnique": false
1614
1636
  },
1615
1637
  "idx_sessions_expires_at_ts": {
1616
1638
  "name": "idx_sessions_expires_at_ts",
1617
- "columns": ["expires_at_ts"],
1639
+ "columns": [
1640
+ "expires_at_ts"
1641
+ ],
1618
1642
  "isUnique": false
1619
1643
  }
1620
1644
  },
@@ -1623,15 +1647,22 @@
1623
1647
  "name": "sessions_tenant_id_tenants_id_fk",
1624
1648
  "tableFrom": "sessions",
1625
1649
  "tableTo": "tenants",
1626
- "columnsFrom": ["tenant_id"],
1627
- "columnsTo": ["id"],
1650
+ "columnsFrom": [
1651
+ "tenant_id"
1652
+ ],
1653
+ "columnsTo": [
1654
+ "id"
1655
+ ],
1628
1656
  "onDelete": "cascade",
1629
1657
  "onUpdate": "no action"
1630
1658
  }
1631
1659
  },
1632
1660
  "compositePrimaryKeys": {
1633
1661
  "sessions_pk": {
1634
- "columns": ["tenant_id", "id"],
1662
+ "columns": [
1663
+ "tenant_id",
1664
+ "id"
1665
+ ],
1635
1666
  "name": "sessions_pk"
1636
1667
  }
1637
1668
  },
@@ -1739,8 +1770,12 @@
1739
1770
  "name": "tickets_tenant_id_tenants_id_fk",
1740
1771
  "tableFrom": "tickets",
1741
1772
  "tableTo": "tenants",
1742
- "columnsFrom": ["tenant_id"],
1743
- "columnsTo": ["id"],
1773
+ "columnsFrom": [
1774
+ "tenant_id"
1775
+ ],
1776
+ "columnsTo": [
1777
+ "id"
1778
+ ],
1744
1779
  "onDelete": "cascade",
1745
1780
  "onUpdate": "no action"
1746
1781
  }
@@ -1844,7 +1879,9 @@
1844
1879
  "indexes": {
1845
1880
  "idx_client_grants_audience": {
1846
1881
  "name": "idx_client_grants_audience",
1847
- "columns": ["audience"],
1882
+ "columns": [
1883
+ "audience"
1884
+ ],
1848
1885
  "isUnique": false
1849
1886
  }
1850
1887
  },
@@ -1853,15 +1890,22 @@
1853
1890
  "name": "client_grants_tenant_id_tenants_id_fk",
1854
1891
  "tableFrom": "client_grants",
1855
1892
  "tableTo": "tenants",
1856
- "columnsFrom": ["tenant_id"],
1857
- "columnsTo": ["id"],
1893
+ "columnsFrom": [
1894
+ "tenant_id"
1895
+ ],
1896
+ "columnsTo": [
1897
+ "id"
1898
+ ],
1858
1899
  "onDelete": "cascade",
1859
1900
  "onUpdate": "no action"
1860
1901
  }
1861
1902
  },
1862
1903
  "compositePrimaryKeys": {
1863
1904
  "pk_client_grants": {
1864
- "columns": ["tenant_id", "id"],
1905
+ "columns": [
1906
+ "tenant_id",
1907
+ "id"
1908
+ ],
1865
1909
  "name": "pk_client_grants"
1866
1910
  }
1867
1911
  },
@@ -2250,15 +2294,22 @@
2250
2294
  "name": "clients_tenant_id_tenants_id_fk",
2251
2295
  "tableFrom": "clients",
2252
2296
  "tableTo": "tenants",
2253
- "columnsFrom": ["tenant_id"],
2254
- "columnsTo": ["id"],
2297
+ "columnsFrom": [
2298
+ "tenant_id"
2299
+ ],
2300
+ "columnsTo": [
2301
+ "id"
2302
+ ],
2255
2303
  "onDelete": "cascade",
2256
2304
  "onUpdate": "no action"
2257
2305
  }
2258
2306
  },
2259
2307
  "compositePrimaryKeys": {
2260
2308
  "clients_tenant_id_client_id": {
2261
- "columns": ["tenant_id", "client_id"],
2309
+ "columns": [
2310
+ "tenant_id",
2311
+ "client_id"
2312
+ ],
2262
2313
  "name": "clients_tenant_id_client_id"
2263
2314
  }
2264
2315
  },
@@ -2372,12 +2423,16 @@
2372
2423
  "indexes": {
2373
2424
  "connections_tenant_id_index": {
2374
2425
  "name": "connections_tenant_id_index",
2375
- "columns": ["tenant_id"],
2426
+ "columns": [
2427
+ "tenant_id"
2428
+ ],
2376
2429
  "isUnique": false
2377
2430
  },
2378
2431
  "connections_id_unique": {
2379
2432
  "name": "connections_id_unique",
2380
- "columns": ["id"],
2433
+ "columns": [
2434
+ "id"
2435
+ ],
2381
2436
  "isUnique": true
2382
2437
  }
2383
2438
  },
@@ -2386,15 +2441,22 @@
2386
2441
  "name": "connections_tenant_id_tenants_id_fk",
2387
2442
  "tableFrom": "connections",
2388
2443
  "tableTo": "tenants",
2389
- "columnsFrom": ["tenant_id"],
2390
- "columnsTo": ["id"],
2444
+ "columnsFrom": [
2445
+ "tenant_id"
2446
+ ],
2447
+ "columnsTo": [
2448
+ "id"
2449
+ ],
2391
2450
  "onDelete": "cascade",
2392
2451
  "onUpdate": "no action"
2393
2452
  }
2394
2453
  },
2395
2454
  "compositePrimaryKeys": {
2396
2455
  "connections_tenant_id_id_pk": {
2397
- "columns": ["tenant_id", "id"],
2456
+ "columns": [
2457
+ "tenant_id",
2458
+ "id"
2459
+ ],
2398
2460
  "name": "connections_tenant_id_id_pk"
2399
2461
  }
2400
2462
  },
@@ -2496,14 +2558,26 @@
2496
2558
  "autoincrement": false
2497
2559
  }
2498
2560
  },
2499
- "indexes": {},
2561
+ "indexes": {
2562
+ "custom_domains_domain_unique": {
2563
+ "name": "custom_domains_domain_unique",
2564
+ "columns": [
2565
+ "domain"
2566
+ ],
2567
+ "isUnique": true
2568
+ }
2569
+ },
2500
2570
  "foreignKeys": {
2501
2571
  "custom_domains_tenant_id_tenants_id_fk": {
2502
2572
  "name": "custom_domains_tenant_id_tenants_id_fk",
2503
2573
  "tableFrom": "custom_domains",
2504
2574
  "tableTo": "tenants",
2505
- "columnsFrom": ["tenant_id"],
2506
- "columnsTo": ["id"],
2575
+ "columnsFrom": [
2576
+ "tenant_id"
2577
+ ],
2578
+ "columnsTo": [
2579
+ "id"
2580
+ ],
2507
2581
  "onDelete": "cascade",
2508
2582
  "onUpdate": "no action"
2509
2583
  }
@@ -2585,8 +2659,12 @@
2585
2659
  "name": "domains_tenant_id_tenants_id_fk",
2586
2660
  "tableFrom": "domains",
2587
2661
  "tableTo": "tenants",
2588
- "columnsFrom": ["tenant_id"],
2589
- "columnsTo": ["id"],
2662
+ "columnsFrom": [
2663
+ "tenant_id"
2664
+ ],
2665
+ "columnsTo": [
2666
+ "id"
2667
+ ],
2590
2668
  "onDelete": "cascade",
2591
2669
  "onUpdate": "no action"
2592
2670
  }
@@ -2714,22 +2792,31 @@
2714
2792
  "indexes": {
2715
2793
  "idx_invites_tenant_id": {
2716
2794
  "name": "idx_invites_tenant_id",
2717
- "columns": ["tenant_id"],
2795
+ "columns": [
2796
+ "tenant_id"
2797
+ ],
2718
2798
  "isUnique": false
2719
2799
  },
2720
2800
  "idx_invites_organization_id": {
2721
2801
  "name": "idx_invites_organization_id",
2722
- "columns": ["organization_id"],
2802
+ "columns": [
2803
+ "organization_id"
2804
+ ],
2723
2805
  "isUnique": false
2724
2806
  },
2725
2807
  "idx_invites_expires_at": {
2726
2808
  "name": "idx_invites_expires_at",
2727
- "columns": ["expires_at"],
2809
+ "columns": [
2810
+ "expires_at"
2811
+ ],
2728
2812
  "isUnique": false
2729
2813
  },
2730
2814
  "idx_invites_tenant_created": {
2731
2815
  "name": "idx_invites_tenant_created",
2732
- "columns": ["tenant_id", "created_at"],
2816
+ "columns": [
2817
+ "tenant_id",
2818
+ "created_at"
2819
+ ],
2733
2820
  "isUnique": false
2734
2821
  }
2735
2822
  },
@@ -2815,7 +2902,9 @@
2815
2902
  "indexes": {
2816
2903
  "idx_organizations_tenant_id": {
2817
2904
  "name": "idx_organizations_tenant_id",
2818
- "columns": ["tenant_id"],
2905
+ "columns": [
2906
+ "tenant_id"
2907
+ ],
2819
2908
  "isUnique": false
2820
2909
  }
2821
2910
  },
@@ -2873,22 +2962,32 @@
2873
2962
  "indexes": {
2874
2963
  "user_organizations_unique": {
2875
2964
  "name": "user_organizations_unique",
2876
- "columns": ["tenant_id", "user_id", "organization_id"],
2965
+ "columns": [
2966
+ "tenant_id",
2967
+ "user_id",
2968
+ "organization_id"
2969
+ ],
2877
2970
  "isUnique": true
2878
2971
  },
2879
2972
  "idx_user_organizations_tenant_id": {
2880
2973
  "name": "idx_user_organizations_tenant_id",
2881
- "columns": ["tenant_id"],
2974
+ "columns": [
2975
+ "tenant_id"
2976
+ ],
2882
2977
  "isUnique": false
2883
2978
  },
2884
2979
  "idx_user_organizations_user_id": {
2885
2980
  "name": "idx_user_organizations_user_id",
2886
- "columns": ["user_id"],
2981
+ "columns": [
2982
+ "user_id"
2983
+ ],
2887
2984
  "isUnique": false
2888
2985
  },
2889
2986
  "idx_user_organizations_organization_id": {
2890
2987
  "name": "idx_user_organizations_organization_id",
2891
- "columns": ["organization_id"],
2988
+ "columns": [
2989
+ "organization_id"
2990
+ ],
2892
2991
  "isUnique": false
2893
2992
  }
2894
2993
  },
@@ -3025,7 +3124,10 @@
3025
3124
  "foreignKeys": {},
3026
3125
  "compositePrimaryKeys": {
3027
3126
  "resource_servers_pk": {
3028
- "columns": ["tenant_id", "id"],
3127
+ "columns": [
3128
+ "tenant_id",
3129
+ "id"
3130
+ ],
3029
3131
  "name": "resource_servers_pk"
3030
3132
  }
3031
3133
  },
@@ -3074,7 +3176,10 @@
3074
3176
  "indexes": {
3075
3177
  "role_permissions_role_fk": {
3076
3178
  "name": "role_permissions_role_fk",
3077
- "columns": ["tenant_id", "role_id"],
3179
+ "columns": [
3180
+ "tenant_id",
3181
+ "role_id"
3182
+ ],
3078
3183
  "isUnique": false
3079
3184
  },
3080
3185
  "role_permissions_permission_fk": {
@@ -3167,7 +3272,10 @@
3167
3272
  "foreignKeys": {},
3168
3273
  "compositePrimaryKeys": {
3169
3274
  "roles_pk": {
3170
- "columns": ["tenant_id", "id"],
3275
+ "columns": [
3276
+ "tenant_id",
3277
+ "id"
3278
+ ],
3171
3279
  "name": "roles_pk"
3172
3280
  }
3173
3281
  },
@@ -3224,7 +3332,10 @@
3224
3332
  "indexes": {
3225
3333
  "user_permissions_user_fk": {
3226
3334
  "name": "user_permissions_user_fk",
3227
- "columns": ["tenant_id", "user_id"],
3335
+ "columns": [
3336
+ "tenant_id",
3337
+ "user_id"
3338
+ ],
3228
3339
  "isUnique": false
3229
3340
  },
3230
3341
  "user_permissions_permission_fk": {
@@ -3238,7 +3349,9 @@
3238
3349
  },
3239
3350
  "user_permissions_organization_fk": {
3240
3351
  "name": "user_permissions_organization_fk",
3241
- "columns": ["organization_id"],
3352
+ "columns": [
3353
+ "organization_id"
3354
+ ],
3242
3355
  "isUnique": false
3243
3356
  }
3244
3357
  },
@@ -3301,24 +3414,37 @@
3301
3414
  "indexes": {
3302
3415
  "user_roles_user_fk": {
3303
3416
  "name": "user_roles_user_fk",
3304
- "columns": ["tenant_id", "user_id"],
3417
+ "columns": [
3418
+ "tenant_id",
3419
+ "user_id"
3420
+ ],
3305
3421
  "isUnique": false
3306
3422
  },
3307
3423
  "user_roles_role_fk": {
3308
3424
  "name": "user_roles_role_fk",
3309
- "columns": ["tenant_id", "role_id"],
3425
+ "columns": [
3426
+ "tenant_id",
3427
+ "role_id"
3428
+ ],
3310
3429
  "isUnique": false
3311
3430
  },
3312
3431
  "user_roles_organization_fk": {
3313
3432
  "name": "user_roles_organization_fk",
3314
- "columns": ["organization_id"],
3433
+ "columns": [
3434
+ "organization_id"
3435
+ ],
3315
3436
  "isUnique": false
3316
3437
  }
3317
3438
  },
3318
3439
  "foreignKeys": {},
3319
3440
  "compositePrimaryKeys": {
3320
3441
  "user_roles_pk": {
3321
- "columns": ["tenant_id", "user_id", "role_id", "organization_id"],
3442
+ "columns": [
3443
+ "tenant_id",
3444
+ "user_id",
3445
+ "role_id",
3446
+ "organization_id"
3447
+ ],
3322
3448
  "name": "user_roles_pk"
3323
3449
  }
3324
3450
  },
@@ -3398,8 +3524,12 @@
3398
3524
  "name": "branding_tenant_id_tenants_id_fk",
3399
3525
  "tableFrom": "branding",
3400
3526
  "tableTo": "tenants",
3401
- "columnsFrom": ["tenant_id"],
3402
- "columnsTo": ["id"],
3527
+ "columnsFrom": [
3528
+ "tenant_id"
3529
+ ],
3530
+ "columnsTo": [
3531
+ "id"
3532
+ ],
3403
3533
  "onDelete": "cascade",
3404
3534
  "onUpdate": "no action"
3405
3535
  }
@@ -3460,15 +3590,23 @@
3460
3590
  "name": "custom_text_tenant_id_tenants_id_fk",
3461
3591
  "tableFrom": "custom_text",
3462
3592
  "tableTo": "tenants",
3463
- "columnsFrom": ["tenant_id"],
3464
- "columnsTo": ["id"],
3593
+ "columnsFrom": [
3594
+ "tenant_id"
3595
+ ],
3596
+ "columnsTo": [
3597
+ "id"
3598
+ ],
3465
3599
  "onDelete": "cascade",
3466
3600
  "onUpdate": "no action"
3467
3601
  }
3468
3602
  },
3469
3603
  "compositePrimaryKeys": {
3470
3604
  "custom_text_tenant_id_prompt_language_pk": {
3471
- "columns": ["tenant_id", "prompt", "language"],
3605
+ "columns": [
3606
+ "tenant_id",
3607
+ "prompt",
3608
+ "language"
3609
+ ],
3472
3610
  "name": "custom_text_tenant_id_prompt_language_pk"
3473
3611
  }
3474
3612
  },
@@ -3592,7 +3730,9 @@
3592
3730
  "indexes": {
3593
3731
  "flows_tenant_id_idx": {
3594
3732
  "name": "flows_tenant_id_idx",
3595
- "columns": ["tenant_id"],
3733
+ "columns": [
3734
+ "tenant_id"
3735
+ ],
3596
3736
  "isUnique": false
3597
3737
  }
3598
3738
  },
@@ -3601,8 +3741,12 @@
3601
3741
  "name": "flows_tenant_id_tenants_id_fk",
3602
3742
  "tableFrom": "flows",
3603
3743
  "tableTo": "tenants",
3604
- "columnsFrom": ["tenant_id"],
3605
- "columnsTo": ["id"],
3744
+ "columnsFrom": [
3745
+ "tenant_id"
3746
+ ],
3747
+ "columnsTo": [
3748
+ "id"
3749
+ ],
3606
3750
  "onDelete": "cascade",
3607
3751
  "onUpdate": "no action"
3608
3752
  }
@@ -3702,7 +3846,9 @@
3702
3846
  "indexes": {
3703
3847
  "forms_tenant_id_idx": {
3704
3848
  "name": "forms_tenant_id_idx",
3705
- "columns": ["tenant_id"],
3849
+ "columns": [
3850
+ "tenant_id"
3851
+ ],
3706
3852
  "isUnique": false
3707
3853
  }
3708
3854
  },
@@ -3711,8 +3857,86 @@
3711
3857
  "name": "forms_tenant_id_tenants_id_fk",
3712
3858
  "tableFrom": "forms",
3713
3859
  "tableTo": "tenants",
3714
- "columnsFrom": ["tenant_id"],
3715
- "columnsTo": ["id"],
3860
+ "columnsFrom": [
3861
+ "tenant_id"
3862
+ ],
3863
+ "columnsTo": [
3864
+ "id"
3865
+ ],
3866
+ "onDelete": "cascade",
3867
+ "onUpdate": "no action"
3868
+ }
3869
+ },
3870
+ "compositePrimaryKeys": {},
3871
+ "uniqueConstraints": {},
3872
+ "checkConstraints": {}
3873
+ },
3874
+ "hook_code": {
3875
+ "name": "hook_code",
3876
+ "columns": {
3877
+ "id": {
3878
+ "name": "id",
3879
+ "type": "text(21)",
3880
+ "primaryKey": true,
3881
+ "notNull": true,
3882
+ "autoincrement": false
3883
+ },
3884
+ "tenant_id": {
3885
+ "name": "tenant_id",
3886
+ "type": "text(191)",
3887
+ "primaryKey": false,
3888
+ "notNull": true,
3889
+ "autoincrement": false
3890
+ },
3891
+ "code": {
3892
+ "name": "code",
3893
+ "type": "text",
3894
+ "primaryKey": false,
3895
+ "notNull": true,
3896
+ "autoincrement": false
3897
+ },
3898
+ "secrets": {
3899
+ "name": "secrets",
3900
+ "type": "text",
3901
+ "primaryKey": false,
3902
+ "notNull": false,
3903
+ "autoincrement": false
3904
+ },
3905
+ "created_at_ts": {
3906
+ "name": "created_at_ts",
3907
+ "type": "integer",
3908
+ "primaryKey": false,
3909
+ "notNull": true,
3910
+ "autoincrement": false
3911
+ },
3912
+ "updated_at_ts": {
3913
+ "name": "updated_at_ts",
3914
+ "type": "integer",
3915
+ "primaryKey": false,
3916
+ "notNull": true,
3917
+ "autoincrement": false
3918
+ }
3919
+ },
3920
+ "indexes": {
3921
+ "hook_code_tenant_id_idx": {
3922
+ "name": "hook_code_tenant_id_idx",
3923
+ "columns": [
3924
+ "tenant_id"
3925
+ ],
3926
+ "isUnique": false
3927
+ }
3928
+ },
3929
+ "foreignKeys": {
3930
+ "hook_code_tenant_id_tenants_id_fk": {
3931
+ "name": "hook_code_tenant_id_tenants_id_fk",
3932
+ "tableFrom": "hook_code",
3933
+ "tableTo": "tenants",
3934
+ "columnsFrom": [
3935
+ "tenant_id"
3936
+ ],
3937
+ "columnsTo": [
3938
+ "id"
3939
+ ],
3716
3940
  "onDelete": "cascade",
3717
3941
  "onUpdate": "no action"
3718
3942
  }
@@ -3801,16 +4025,35 @@
3801
4025
  "primaryKey": false,
3802
4026
  "notNull": false,
3803
4027
  "autoincrement": false
4028
+ },
4029
+ "code_id": {
4030
+ "name": "code_id",
4031
+ "type": "text(21)",
4032
+ "primaryKey": false,
4033
+ "notNull": false,
4034
+ "autoincrement": false
4035
+ }
4036
+ },
4037
+ "indexes": {
4038
+ "hooks_tenant_id_idx": {
4039
+ "name": "hooks_tenant_id_idx",
4040
+ "columns": [
4041
+ "tenant_id"
4042
+ ],
4043
+ "isUnique": false
3804
4044
  }
3805
4045
  },
3806
- "indexes": {},
3807
4046
  "foreignKeys": {
3808
4047
  "hooks_tenant_id_tenants_id_fk": {
3809
4048
  "name": "hooks_tenant_id_tenants_id_fk",
3810
4049
  "tableFrom": "hooks",
3811
4050
  "tableTo": "tenants",
3812
- "columnsFrom": ["tenant_id"],
3813
- "columnsTo": ["id"],
4051
+ "columnsFrom": [
4052
+ "tenant_id"
4053
+ ],
4054
+ "columnsTo": [
4055
+ "id"
4056
+ ],
3814
4057
  "onDelete": "cascade",
3815
4058
  "onUpdate": "no action"
3816
4059
  }
@@ -3914,8 +4157,12 @@
3914
4157
  "name": "keys_tenant_id_tenants_id_fk",
3915
4158
  "tableFrom": "keys",
3916
4159
  "tableTo": "tenants",
3917
- "columnsFrom": ["tenant_id"],
3918
- "columnsTo": ["id"],
4160
+ "columnsFrom": [
4161
+ "tenant_id"
4162
+ ],
4163
+ "columnsTo": [
4164
+ "id"
4165
+ ],
3919
4166
  "onDelete": "cascade",
3920
4167
  "onUpdate": "no action"
3921
4168
  },
@@ -3923,8 +4170,12 @@
3923
4170
  "name": "keys_connection_connections_id_fk",
3924
4171
  "tableFrom": "keys",
3925
4172
  "tableTo": "connections",
3926
- "columnsFrom": ["connection"],
3927
- "columnsTo": ["id"],
4173
+ "columnsFrom": [
4174
+ "connection"
4175
+ ],
4176
+ "columnsTo": [
4177
+ "id"
4178
+ ],
3928
4179
  "onDelete": "cascade",
3929
4180
  "onUpdate": "no action"
3930
4181
  }
@@ -4381,7 +4632,9 @@
4381
4632
  "indexes": {
4382
4633
  "themes_tenant_id_idx": {
4383
4634
  "name": "themes_tenant_id_idx",
4384
- "columns": ["tenant_id"],
4635
+ "columns": [
4636
+ "tenant_id"
4637
+ ],
4385
4638
  "isUnique": false
4386
4639
  }
4387
4640
  },
@@ -4390,15 +4643,22 @@
4390
4643
  "name": "themes_tenant_id_tenants_id_fk",
4391
4644
  "tableFrom": "themes",
4392
4645
  "tableTo": "tenants",
4393
- "columnsFrom": ["tenant_id"],
4394
- "columnsTo": ["id"],
4646
+ "columnsFrom": [
4647
+ "tenant_id"
4648
+ ],
4649
+ "columnsTo": [
4650
+ "id"
4651
+ ],
4395
4652
  "onDelete": "cascade",
4396
4653
  "onUpdate": "no action"
4397
4654
  }
4398
4655
  },
4399
4656
  "compositePrimaryKeys": {
4400
4657
  "themes_pkey": {
4401
- "columns": ["tenant_id", "themeId"],
4658
+ "columns": [
4659
+ "tenant_id",
4660
+ "themeId"
4661
+ ],
4402
4662
  "name": "themes_pkey"
4403
4663
  }
4404
4664
  },
@@ -4443,8 +4703,12 @@
4443
4703
  "name": "universal_login_templates_tenant_id_tenants_id_fk",
4444
4704
  "tableFrom": "universal_login_templates",
4445
4705
  "tableTo": "tenants",
4446
- "columnsFrom": ["tenant_id"],
4447
- "columnsTo": ["id"],
4706
+ "columnsFrom": [
4707
+ "tenant_id"
4708
+ ],
4709
+ "columnsTo": [
4710
+ "id"
4711
+ ],
4448
4712
  "onDelete": "cascade",
4449
4713
  "onUpdate": "no action"
4450
4714
  }
@@ -4566,12 +4830,17 @@
4566
4830
  "indexes": {
4567
4831
  "authentication_methods_tenant_user_idx": {
4568
4832
  "name": "authentication_methods_tenant_user_idx",
4569
- "columns": ["tenant_id", "user_id"],
4833
+ "columns": [
4834
+ "tenant_id",
4835
+ "user_id"
4836
+ ],
4570
4837
  "isUnique": false
4571
4838
  },
4572
4839
  "authentication_methods_credential_id_idx": {
4573
4840
  "name": "authentication_methods_credential_id_idx",
4574
- "columns": ["credential_id"],
4841
+ "columns": [
4842
+ "credential_id"
4843
+ ],
4575
4844
  "isUnique": false
4576
4845
  }
4577
4846
  },
@@ -4580,8 +4849,12 @@
4580
4849
  "name": "authentication_methods_tenant_id_tenants_id_fk",
4581
4850
  "tableFrom": "authentication_methods",
4582
4851
  "tableTo": "tenants",
4583
- "columnsFrom": ["tenant_id"],
4584
- "columnsTo": ["id"],
4852
+ "columnsFrom": [
4853
+ "tenant_id"
4854
+ ],
4855
+ "columnsTo": [
4856
+ "id"
4857
+ ],
4585
4858
  "onDelete": "cascade",
4586
4859
  "onUpdate": "no action"
4587
4860
  }
@@ -4800,22 +5073,33 @@
4800
5073
  "indexes": {
4801
5074
  "logs_user_id": {
4802
5075
  "name": "logs_user_id",
4803
- "columns": ["user_id"],
5076
+ "columns": [
5077
+ "user_id"
5078
+ ],
4804
5079
  "isUnique": false
4805
5080
  },
4806
5081
  "logs_tenant_id": {
4807
5082
  "name": "logs_tenant_id",
4808
- "columns": ["tenant_id"],
5083
+ "columns": [
5084
+ "tenant_id"
5085
+ ],
4809
5086
  "isUnique": false
4810
5087
  },
4811
5088
  "logs_date": {
4812
5089
  "name": "logs_date",
4813
- "columns": ["date"],
5090
+ "columns": [
5091
+ "date"
5092
+ ],
4814
5093
  "isUnique": false
4815
5094
  },
4816
5095
  "IDX_logs_tenant_date_type_user": {
4817
5096
  "name": "IDX_logs_tenant_date_type_user",
4818
- "columns": ["tenant_id", "date", "type", "user_id"],
5097
+ "columns": [
5098
+ "tenant_id",
5099
+ "date",
5100
+ "type",
5101
+ "user_id"
5102
+ ],
4819
5103
  "isUnique": false
4820
5104
  }
4821
5105
  },
@@ -4925,22 +5209,50 @@
4925
5209
  "primaryKey": false,
4926
5210
  "notNull": false,
4927
5211
  "autoincrement": false
5212
+ },
5213
+ "dead_lettered_at": {
5214
+ "name": "dead_lettered_at",
5215
+ "type": "text(35)",
5216
+ "primaryKey": false,
5217
+ "notNull": false,
5218
+ "autoincrement": false
5219
+ },
5220
+ "final_error": {
5221
+ "name": "final_error",
5222
+ "type": "text",
5223
+ "primaryKey": false,
5224
+ "notNull": false,
5225
+ "autoincrement": false
4928
5226
  }
4929
5227
  },
4930
5228
  "indexes": {
4931
5229
  "idx_outbox_events_tenant_id": {
4932
5230
  "name": "idx_outbox_events_tenant_id",
4933
- "columns": ["tenant_id"],
5231
+ "columns": [
5232
+ "tenant_id"
5233
+ ],
4934
5234
  "isUnique": false
4935
5235
  },
4936
5236
  "idx_outbox_events_processed_at": {
4937
5237
  "name": "idx_outbox_events_processed_at",
4938
- "columns": ["processed_at"],
5238
+ "columns": [
5239
+ "processed_at"
5240
+ ],
4939
5241
  "isUnique": false
4940
5242
  },
4941
5243
  "idx_outbox_events_claimed_by": {
4942
5244
  "name": "idx_outbox_events_claimed_by",
4943
- "columns": ["claimed_by"],
5245
+ "columns": [
5246
+ "claimed_by"
5247
+ ],
5248
+ "isUnique": false
5249
+ },
5250
+ "idx_outbox_events_tenant_dead_lettered": {
5251
+ "name": "idx_outbox_events_tenant_dead_lettered",
5252
+ "columns": [
5253
+ "tenant_id",
5254
+ "dead_lettered_at"
5255
+ ],
4944
5256
  "isUnique": false
4945
5257
  }
4946
5258
  },
@@ -4949,8 +5261,12 @@
4949
5261
  "name": "outbox_events_tenant_id_tenants_id_fk",
4950
5262
  "tableFrom": "outbox_events",
4951
5263
  "tableTo": "tenants",
4952
- "columnsFrom": ["tenant_id"],
4953
- "columnsTo": ["id"],
5264
+ "columnsFrom": [
5265
+ "tenant_id"
5266
+ ],
5267
+ "columnsTo": [
5268
+ "id"
5269
+ ],
4954
5270
  "onDelete": "cascade",
4955
5271
  "onUpdate": "no action"
4956
5272
  }
@@ -4970,4 +5286,4 @@
4970
5286
  "internal": {
4971
5287
  "indexes": {}
4972
5288
  }
4973
- }
5289
+ }