@authhero/drizzle 0.31.3 → 0.33.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": "344580d9-98c4-4ecd-92cf-b8085be3ea47",
4
+ "id": "ab4ec13b-e783-4cf8-a351-d433e6170867",
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
  }
@@ -640,37 +644,59 @@
640
644
  "indexes": {
641
645
  "unique_email_provider": {
642
646
  "name": "unique_email_provider",
643
- "columns": ["email", "provider", "tenant_id"],
647
+ "columns": [
648
+ "email",
649
+ "provider",
650
+ "tenant_id"
651
+ ],
644
652
  "isUnique": true
645
653
  },
646
654
  "unique_phone_provider": {
647
655
  "name": "unique_phone_provider",
648
- "columns": ["phone_number", "provider", "tenant_id"],
656
+ "columns": [
657
+ "phone_number",
658
+ "provider",
659
+ "tenant_id"
660
+ ],
649
661
  "isUnique": true
650
662
  },
651
663
  "unique_username_provider": {
652
664
  "name": "unique_username_provider",
653
- "columns": ["username", "provider", "tenant_id"],
665
+ "columns": [
666
+ "username",
667
+ "provider",
668
+ "tenant_id"
669
+ ],
654
670
  "isUnique": true
655
671
  },
656
672
  "users_email_index": {
657
673
  "name": "users_email_index",
658
- "columns": ["email"],
674
+ "columns": [
675
+ "email"
676
+ ],
659
677
  "isUnique": false
660
678
  },
661
679
  "users_linked_to_index": {
662
680
  "name": "users_linked_to_index",
663
- "columns": ["linked_to"],
681
+ "columns": [
682
+ "linked_to"
683
+ ],
664
684
  "isUnique": false
665
685
  },
666
686
  "users_name_index": {
667
687
  "name": "users_name_index",
668
- "columns": ["name"],
688
+ "columns": [
689
+ "name"
690
+ ],
669
691
  "isUnique": false
670
692
  },
671
693
  "users_phone_tenant_provider_index": {
672
694
  "name": "users_phone_tenant_provider_index",
673
- "columns": ["tenant_id", "phone_number", "provider"],
695
+ "columns": [
696
+ "tenant_id",
697
+ "phone_number",
698
+ "provider"
699
+ ],
674
700
  "isUnique": false
675
701
  }
676
702
  },
@@ -679,15 +705,22 @@
679
705
  "name": "users_tenant_id_tenants_id_fk",
680
706
  "tableFrom": "users",
681
707
  "tableTo": "tenants",
682
- "columnsFrom": ["tenant_id"],
683
- "columnsTo": ["id"],
708
+ "columnsFrom": [
709
+ "tenant_id"
710
+ ],
711
+ "columnsTo": [
712
+ "id"
713
+ ],
684
714
  "onDelete": "cascade",
685
715
  "onUpdate": "no action"
686
716
  }
687
717
  },
688
718
  "compositePrimaryKeys": {
689
719
  "users_tenants": {
690
- "columns": ["user_id", "tenant_id"],
720
+ "columns": [
721
+ "user_id",
722
+ "tenant_id"
723
+ ],
691
724
  "name": "users_tenants"
692
725
  }
693
726
  },
@@ -795,8 +828,12 @@
795
828
  "name": "authentication_codes_tenant_id_tenants_id_fk",
796
829
  "tableFrom": "authentication_codes",
797
830
  "tableTo": "tenants",
798
- "columnsFrom": ["tenant_id"],
799
- "columnsTo": ["id"],
831
+ "columnsFrom": [
832
+ "tenant_id"
833
+ ],
834
+ "columnsTo": [
835
+ "id"
836
+ ],
800
837
  "onDelete": "cascade",
801
838
  "onUpdate": "no action"
802
839
  }
@@ -917,7 +954,9 @@
917
954
  "indexes": {
918
955
  "codes_expires_at_index": {
919
956
  "name": "codes_expires_at_index",
920
- "columns": ["expires_at"],
957
+ "columns": [
958
+ "expires_at"
959
+ ],
921
960
  "isUnique": false
922
961
  }
923
962
  },
@@ -926,15 +965,22 @@
926
965
  "name": "codes_tenant_id_tenants_id_fk",
927
966
  "tableFrom": "codes",
928
967
  "tableTo": "tenants",
929
- "columnsFrom": ["tenant_id"],
930
- "columnsTo": ["id"],
968
+ "columnsFrom": [
969
+ "tenant_id"
970
+ ],
971
+ "columnsTo": [
972
+ "id"
973
+ ],
931
974
  "onDelete": "cascade",
932
975
  "onUpdate": "no action"
933
976
  }
934
977
  },
935
978
  "compositePrimaryKeys": {
936
979
  "PK_codes_code_id_code_type": {
937
- "columns": ["code_id", "code_type"],
980
+ "columns": [
981
+ "code_id",
982
+ "code_type"
983
+ ],
938
984
  "name": "PK_codes_code_id_code_type"
939
985
  }
940
986
  },
@@ -1161,32 +1207,51 @@
1161
1207
  "primaryKey": false,
1162
1208
  "notNull": false,
1163
1209
  "autoincrement": false
1210
+ },
1211
+ "auth_connection": {
1212
+ "name": "auth_connection",
1213
+ "type": "text(255)",
1214
+ "primaryKey": false,
1215
+ "notNull": false,
1216
+ "autoincrement": false
1164
1217
  }
1165
1218
  },
1166
1219
  "indexes": {
1167
1220
  "login_sessions_id_index": {
1168
1221
  "name": "login_sessions_id_index",
1169
- "columns": ["id"],
1222
+ "columns": [
1223
+ "id"
1224
+ ],
1170
1225
  "isUnique": false
1171
1226
  },
1172
1227
  "login_sessions_state_idx": {
1173
1228
  "name": "login_sessions_state_idx",
1174
- "columns": ["state"],
1229
+ "columns": [
1230
+ "state"
1231
+ ],
1175
1232
  "isUnique": false
1176
1233
  },
1177
1234
  "login_sessions_state_updated_idx": {
1178
1235
  "name": "login_sessions_state_updated_idx",
1179
- "columns": ["state", "updated_at_ts"],
1236
+ "columns": [
1237
+ "state",
1238
+ "updated_at_ts"
1239
+ ],
1180
1240
  "isUnique": false
1181
1241
  },
1182
1242
  "login_sessions_tenant_user_idx": {
1183
1243
  "name": "login_sessions_tenant_user_idx",
1184
- "columns": ["tenant_id", "user_id"],
1244
+ "columns": [
1245
+ "tenant_id",
1246
+ "user_id"
1247
+ ],
1185
1248
  "isUnique": false
1186
1249
  },
1187
1250
  "idx_login_sessions_expires_at_ts": {
1188
1251
  "name": "idx_login_sessions_expires_at_ts",
1189
- "columns": ["expires_at_ts"],
1252
+ "columns": [
1253
+ "expires_at_ts"
1254
+ ],
1190
1255
  "isUnique": false
1191
1256
  }
1192
1257
  },
@@ -1195,15 +1260,22 @@
1195
1260
  "name": "login_sessions_tenant_id_tenants_id_fk",
1196
1261
  "tableFrom": "login_sessions",
1197
1262
  "tableTo": "tenants",
1198
- "columnsFrom": ["tenant_id"],
1199
- "columnsTo": ["id"],
1263
+ "columnsFrom": [
1264
+ "tenant_id"
1265
+ ],
1266
+ "columnsTo": [
1267
+ "id"
1268
+ ],
1200
1269
  "onDelete": "cascade",
1201
1270
  "onUpdate": "no action"
1202
1271
  }
1203
1272
  },
1204
1273
  "compositePrimaryKeys": {
1205
1274
  "login_sessions_pk": {
1206
- "columns": ["tenant_id", "id"],
1275
+ "columns": [
1276
+ "tenant_id",
1277
+ "id"
1278
+ ],
1207
1279
  "name": "login_sessions_pk"
1208
1280
  }
1209
1281
  },
@@ -1343,12 +1415,16 @@
1343
1415
  "indexes": {
1344
1416
  "otps_email_index": {
1345
1417
  "name": "otps_email_index",
1346
- "columns": ["email"],
1418
+ "columns": [
1419
+ "email"
1420
+ ],
1347
1421
  "isUnique": false
1348
1422
  },
1349
1423
  "otps_expires_at_index": {
1350
1424
  "name": "otps_expires_at_index",
1351
- "columns": ["expires_at"],
1425
+ "columns": [
1426
+ "expires_at"
1427
+ ],
1352
1428
  "isUnique": false
1353
1429
  }
1354
1430
  },
@@ -1357,8 +1433,12 @@
1357
1433
  "name": "otps_tenant_id_tenants_id_fk",
1358
1434
  "tableFrom": "otps",
1359
1435
  "tableTo": "tenants",
1360
- "columnsFrom": ["tenant_id"],
1361
- "columnsTo": ["id"],
1436
+ "columnsFrom": [
1437
+ "tenant_id"
1438
+ ],
1439
+ "columnsTo": [
1440
+ "id"
1441
+ ],
1362
1442
  "onDelete": "cascade",
1363
1443
  "onUpdate": "no action"
1364
1444
  }
@@ -1391,8 +1471,8 @@
1391
1471
  "notNull": true,
1392
1472
  "autoincrement": false
1393
1473
  },
1394
- "session_id": {
1395
- "name": "session_id",
1474
+ "login_id": {
1475
+ "name": "login_id",
1396
1476
  "type": "text(21)",
1397
1477
  "primaryKey": false,
1398
1478
  "notNull": true,
@@ -1458,17 +1538,24 @@
1458
1538
  "indexes": {
1459
1539
  "idx_refresh_tokens_user_id": {
1460
1540
  "name": "idx_refresh_tokens_user_id",
1461
- "columns": ["tenant_id", "user_id"],
1541
+ "columns": [
1542
+ "tenant_id",
1543
+ "user_id"
1544
+ ],
1462
1545
  "isUnique": false
1463
1546
  },
1464
- "idx_refresh_tokens_session_id": {
1465
- "name": "idx_refresh_tokens_session_id",
1466
- "columns": ["session_id"],
1547
+ "idx_refresh_tokens_login_id": {
1548
+ "name": "idx_refresh_tokens_login_id",
1549
+ "columns": [
1550
+ "login_id"
1551
+ ],
1467
1552
  "isUnique": false
1468
1553
  },
1469
1554
  "idx_refresh_tokens_expires_at_ts": {
1470
1555
  "name": "idx_refresh_tokens_expires_at_ts",
1471
- "columns": ["expires_at_ts"],
1556
+ "columns": [
1557
+ "expires_at_ts"
1558
+ ],
1472
1559
  "isUnique": false
1473
1560
  }
1474
1561
  },
@@ -1477,15 +1564,22 @@
1477
1564
  "name": "refresh_tokens_tenant_id_tenants_id_fk",
1478
1565
  "tableFrom": "refresh_tokens",
1479
1566
  "tableTo": "tenants",
1480
- "columnsFrom": ["tenant_id"],
1481
- "columnsTo": ["id"],
1567
+ "columnsFrom": [
1568
+ "tenant_id"
1569
+ ],
1570
+ "columnsTo": [
1571
+ "id"
1572
+ ],
1482
1573
  "onDelete": "cascade",
1483
1574
  "onUpdate": "no action"
1484
1575
  }
1485
1576
  },
1486
1577
  "compositePrimaryKeys": {
1487
1578
  "refresh_tokens_pk": {
1488
- "columns": ["tenant_id", "id"],
1579
+ "columns": [
1580
+ "tenant_id",
1581
+ "id"
1582
+ ],
1489
1583
  "name": "refresh_tokens_pk"
1490
1584
  }
1491
1585
  },
@@ -1597,17 +1691,24 @@
1597
1691
  "indexes": {
1598
1692
  "IDX_sessions_login_session_id": {
1599
1693
  "name": "IDX_sessions_login_session_id",
1600
- "columns": ["login_session_id"],
1694
+ "columns": [
1695
+ "login_session_id"
1696
+ ],
1601
1697
  "isUnique": false
1602
1698
  },
1603
1699
  "idx_sessions_user_id": {
1604
1700
  "name": "idx_sessions_user_id",
1605
- "columns": ["tenant_id", "user_id"],
1701
+ "columns": [
1702
+ "tenant_id",
1703
+ "user_id"
1704
+ ],
1606
1705
  "isUnique": false
1607
1706
  },
1608
1707
  "idx_sessions_expires_at_ts": {
1609
1708
  "name": "idx_sessions_expires_at_ts",
1610
- "columns": ["expires_at_ts"],
1709
+ "columns": [
1710
+ "expires_at_ts"
1711
+ ],
1611
1712
  "isUnique": false
1612
1713
  }
1613
1714
  },
@@ -1616,15 +1717,22 @@
1616
1717
  "name": "sessions_tenant_id_tenants_id_fk",
1617
1718
  "tableFrom": "sessions",
1618
1719
  "tableTo": "tenants",
1619
- "columnsFrom": ["tenant_id"],
1620
- "columnsTo": ["id"],
1720
+ "columnsFrom": [
1721
+ "tenant_id"
1722
+ ],
1723
+ "columnsTo": [
1724
+ "id"
1725
+ ],
1621
1726
  "onDelete": "cascade",
1622
1727
  "onUpdate": "no action"
1623
1728
  }
1624
1729
  },
1625
1730
  "compositePrimaryKeys": {
1626
1731
  "sessions_pk": {
1627
- "columns": ["tenant_id", "id"],
1732
+ "columns": [
1733
+ "tenant_id",
1734
+ "id"
1735
+ ],
1628
1736
  "name": "sessions_pk"
1629
1737
  }
1630
1738
  },
@@ -1732,8 +1840,12 @@
1732
1840
  "name": "tickets_tenant_id_tenants_id_fk",
1733
1841
  "tableFrom": "tickets",
1734
1842
  "tableTo": "tenants",
1735
- "columnsFrom": ["tenant_id"],
1736
- "columnsTo": ["id"],
1843
+ "columnsFrom": [
1844
+ "tenant_id"
1845
+ ],
1846
+ "columnsTo": [
1847
+ "id"
1848
+ ],
1737
1849
  "onDelete": "cascade",
1738
1850
  "onUpdate": "no action"
1739
1851
  }
@@ -1837,7 +1949,9 @@
1837
1949
  "indexes": {
1838
1950
  "idx_client_grants_audience": {
1839
1951
  "name": "idx_client_grants_audience",
1840
- "columns": ["audience"],
1952
+ "columns": [
1953
+ "audience"
1954
+ ],
1841
1955
  "isUnique": false
1842
1956
  }
1843
1957
  },
@@ -1846,15 +1960,22 @@
1846
1960
  "name": "client_grants_tenant_id_tenants_id_fk",
1847
1961
  "tableFrom": "client_grants",
1848
1962
  "tableTo": "tenants",
1849
- "columnsFrom": ["tenant_id"],
1850
- "columnsTo": ["id"],
1963
+ "columnsFrom": [
1964
+ "tenant_id"
1965
+ ],
1966
+ "columnsTo": [
1967
+ "id"
1968
+ ],
1851
1969
  "onDelete": "cascade",
1852
1970
  "onUpdate": "no action"
1853
1971
  }
1854
1972
  },
1855
1973
  "compositePrimaryKeys": {
1856
1974
  "pk_client_grants": {
1857
- "columns": ["tenant_id", "id"],
1975
+ "columns": [
1976
+ "tenant_id",
1977
+ "id"
1978
+ ],
1858
1979
  "name": "pk_client_grants"
1859
1980
  }
1860
1981
  },
@@ -2243,15 +2364,22 @@
2243
2364
  "name": "clients_tenant_id_tenants_id_fk",
2244
2365
  "tableFrom": "clients",
2245
2366
  "tableTo": "tenants",
2246
- "columnsFrom": ["tenant_id"],
2247
- "columnsTo": ["id"],
2367
+ "columnsFrom": [
2368
+ "tenant_id"
2369
+ ],
2370
+ "columnsTo": [
2371
+ "id"
2372
+ ],
2248
2373
  "onDelete": "cascade",
2249
2374
  "onUpdate": "no action"
2250
2375
  }
2251
2376
  },
2252
2377
  "compositePrimaryKeys": {
2253
2378
  "clients_tenant_id_client_id": {
2254
- "columns": ["tenant_id", "client_id"],
2379
+ "columns": [
2380
+ "tenant_id",
2381
+ "client_id"
2382
+ ],
2255
2383
  "name": "clients_tenant_id_client_id"
2256
2384
  }
2257
2385
  },
@@ -2365,12 +2493,16 @@
2365
2493
  "indexes": {
2366
2494
  "connections_tenant_id_index": {
2367
2495
  "name": "connections_tenant_id_index",
2368
- "columns": ["tenant_id"],
2496
+ "columns": [
2497
+ "tenant_id"
2498
+ ],
2369
2499
  "isUnique": false
2370
2500
  },
2371
2501
  "connections_id_unique": {
2372
2502
  "name": "connections_id_unique",
2373
- "columns": ["id"],
2503
+ "columns": [
2504
+ "id"
2505
+ ],
2374
2506
  "isUnique": true
2375
2507
  }
2376
2508
  },
@@ -2379,15 +2511,22 @@
2379
2511
  "name": "connections_tenant_id_tenants_id_fk",
2380
2512
  "tableFrom": "connections",
2381
2513
  "tableTo": "tenants",
2382
- "columnsFrom": ["tenant_id"],
2383
- "columnsTo": ["id"],
2514
+ "columnsFrom": [
2515
+ "tenant_id"
2516
+ ],
2517
+ "columnsTo": [
2518
+ "id"
2519
+ ],
2384
2520
  "onDelete": "cascade",
2385
2521
  "onUpdate": "no action"
2386
2522
  }
2387
2523
  },
2388
2524
  "compositePrimaryKeys": {
2389
2525
  "connections_tenant_id_id_pk": {
2390
- "columns": ["tenant_id", "id"],
2526
+ "columns": [
2527
+ "tenant_id",
2528
+ "id"
2529
+ ],
2391
2530
  "name": "connections_tenant_id_id_pk"
2392
2531
  }
2393
2532
  },
@@ -2495,8 +2634,12 @@
2495
2634
  "name": "custom_domains_tenant_id_tenants_id_fk",
2496
2635
  "tableFrom": "custom_domains",
2497
2636
  "tableTo": "tenants",
2498
- "columnsFrom": ["tenant_id"],
2499
- "columnsTo": ["id"],
2637
+ "columnsFrom": [
2638
+ "tenant_id"
2639
+ ],
2640
+ "columnsTo": [
2641
+ "id"
2642
+ ],
2500
2643
  "onDelete": "cascade",
2501
2644
  "onUpdate": "no action"
2502
2645
  }
@@ -2578,8 +2721,12 @@
2578
2721
  "name": "domains_tenant_id_tenants_id_fk",
2579
2722
  "tableFrom": "domains",
2580
2723
  "tableTo": "tenants",
2581
- "columnsFrom": ["tenant_id"],
2582
- "columnsTo": ["id"],
2724
+ "columnsFrom": [
2725
+ "tenant_id"
2726
+ ],
2727
+ "columnsTo": [
2728
+ "id"
2729
+ ],
2583
2730
  "onDelete": "cascade",
2584
2731
  "onUpdate": "no action"
2585
2732
  }
@@ -2707,22 +2854,31 @@
2707
2854
  "indexes": {
2708
2855
  "idx_invites_tenant_id": {
2709
2856
  "name": "idx_invites_tenant_id",
2710
- "columns": ["tenant_id"],
2857
+ "columns": [
2858
+ "tenant_id"
2859
+ ],
2711
2860
  "isUnique": false
2712
2861
  },
2713
2862
  "idx_invites_organization_id": {
2714
2863
  "name": "idx_invites_organization_id",
2715
- "columns": ["organization_id"],
2864
+ "columns": [
2865
+ "organization_id"
2866
+ ],
2716
2867
  "isUnique": false
2717
2868
  },
2718
2869
  "idx_invites_expires_at": {
2719
2870
  "name": "idx_invites_expires_at",
2720
- "columns": ["expires_at"],
2871
+ "columns": [
2872
+ "expires_at"
2873
+ ],
2721
2874
  "isUnique": false
2722
2875
  },
2723
2876
  "idx_invites_tenant_created": {
2724
2877
  "name": "idx_invites_tenant_created",
2725
- "columns": ["tenant_id", "created_at"],
2878
+ "columns": [
2879
+ "tenant_id",
2880
+ "created_at"
2881
+ ],
2726
2882
  "isUnique": false
2727
2883
  }
2728
2884
  },
@@ -2808,7 +2964,9 @@
2808
2964
  "indexes": {
2809
2965
  "idx_organizations_tenant_id": {
2810
2966
  "name": "idx_organizations_tenant_id",
2811
- "columns": ["tenant_id"],
2967
+ "columns": [
2968
+ "tenant_id"
2969
+ ],
2812
2970
  "isUnique": false
2813
2971
  }
2814
2972
  },
@@ -2866,22 +3024,32 @@
2866
3024
  "indexes": {
2867
3025
  "user_organizations_unique": {
2868
3026
  "name": "user_organizations_unique",
2869
- "columns": ["tenant_id", "user_id", "organization_id"],
3027
+ "columns": [
3028
+ "tenant_id",
3029
+ "user_id",
3030
+ "organization_id"
3031
+ ],
2870
3032
  "isUnique": true
2871
3033
  },
2872
3034
  "idx_user_organizations_tenant_id": {
2873
3035
  "name": "idx_user_organizations_tenant_id",
2874
- "columns": ["tenant_id"],
3036
+ "columns": [
3037
+ "tenant_id"
3038
+ ],
2875
3039
  "isUnique": false
2876
3040
  },
2877
3041
  "idx_user_organizations_user_id": {
2878
3042
  "name": "idx_user_organizations_user_id",
2879
- "columns": ["user_id"],
3043
+ "columns": [
3044
+ "user_id"
3045
+ ],
2880
3046
  "isUnique": false
2881
3047
  },
2882
3048
  "idx_user_organizations_organization_id": {
2883
3049
  "name": "idx_user_organizations_organization_id",
2884
- "columns": ["organization_id"],
3050
+ "columns": [
3051
+ "organization_id"
3052
+ ],
2885
3053
  "isUnique": false
2886
3054
  }
2887
3055
  },
@@ -3018,7 +3186,10 @@
3018
3186
  "foreignKeys": {},
3019
3187
  "compositePrimaryKeys": {
3020
3188
  "resource_servers_pk": {
3021
- "columns": ["tenant_id", "id"],
3189
+ "columns": [
3190
+ "tenant_id",
3191
+ "id"
3192
+ ],
3022
3193
  "name": "resource_servers_pk"
3023
3194
  }
3024
3195
  },
@@ -3067,7 +3238,10 @@
3067
3238
  "indexes": {
3068
3239
  "role_permissions_role_fk": {
3069
3240
  "name": "role_permissions_role_fk",
3070
- "columns": ["tenant_id", "role_id"],
3241
+ "columns": [
3242
+ "tenant_id",
3243
+ "role_id"
3244
+ ],
3071
3245
  "isUnique": false
3072
3246
  },
3073
3247
  "role_permissions_permission_fk": {
@@ -3160,7 +3334,10 @@
3160
3334
  "foreignKeys": {},
3161
3335
  "compositePrimaryKeys": {
3162
3336
  "roles_pk": {
3163
- "columns": ["tenant_id", "id"],
3337
+ "columns": [
3338
+ "tenant_id",
3339
+ "id"
3340
+ ],
3164
3341
  "name": "roles_pk"
3165
3342
  }
3166
3343
  },
@@ -3217,7 +3394,10 @@
3217
3394
  "indexes": {
3218
3395
  "user_permissions_user_fk": {
3219
3396
  "name": "user_permissions_user_fk",
3220
- "columns": ["tenant_id", "user_id"],
3397
+ "columns": [
3398
+ "tenant_id",
3399
+ "user_id"
3400
+ ],
3221
3401
  "isUnique": false
3222
3402
  },
3223
3403
  "user_permissions_permission_fk": {
@@ -3231,7 +3411,9 @@
3231
3411
  },
3232
3412
  "user_permissions_organization_fk": {
3233
3413
  "name": "user_permissions_organization_fk",
3234
- "columns": ["organization_id"],
3414
+ "columns": [
3415
+ "organization_id"
3416
+ ],
3235
3417
  "isUnique": false
3236
3418
  }
3237
3419
  },
@@ -3294,24 +3476,37 @@
3294
3476
  "indexes": {
3295
3477
  "user_roles_user_fk": {
3296
3478
  "name": "user_roles_user_fk",
3297
- "columns": ["tenant_id", "user_id"],
3479
+ "columns": [
3480
+ "tenant_id",
3481
+ "user_id"
3482
+ ],
3298
3483
  "isUnique": false
3299
3484
  },
3300
3485
  "user_roles_role_fk": {
3301
3486
  "name": "user_roles_role_fk",
3302
- "columns": ["tenant_id", "role_id"],
3487
+ "columns": [
3488
+ "tenant_id",
3489
+ "role_id"
3490
+ ],
3303
3491
  "isUnique": false
3304
3492
  },
3305
3493
  "user_roles_organization_fk": {
3306
3494
  "name": "user_roles_organization_fk",
3307
- "columns": ["organization_id"],
3495
+ "columns": [
3496
+ "organization_id"
3497
+ ],
3308
3498
  "isUnique": false
3309
3499
  }
3310
3500
  },
3311
3501
  "foreignKeys": {},
3312
3502
  "compositePrimaryKeys": {
3313
3503
  "user_roles_pk": {
3314
- "columns": ["tenant_id", "user_id", "role_id", "organization_id"],
3504
+ "columns": [
3505
+ "tenant_id",
3506
+ "user_id",
3507
+ "role_id",
3508
+ "organization_id"
3509
+ ],
3315
3510
  "name": "user_roles_pk"
3316
3511
  }
3317
3512
  },
@@ -3391,8 +3586,12 @@
3391
3586
  "name": "branding_tenant_id_tenants_id_fk",
3392
3587
  "tableFrom": "branding",
3393
3588
  "tableTo": "tenants",
3394
- "columnsFrom": ["tenant_id"],
3395
- "columnsTo": ["id"],
3589
+ "columnsFrom": [
3590
+ "tenant_id"
3591
+ ],
3592
+ "columnsTo": [
3593
+ "id"
3594
+ ],
3396
3595
  "onDelete": "cascade",
3397
3596
  "onUpdate": "no action"
3398
3597
  }
@@ -3453,15 +3652,23 @@
3453
3652
  "name": "custom_text_tenant_id_tenants_id_fk",
3454
3653
  "tableFrom": "custom_text",
3455
3654
  "tableTo": "tenants",
3456
- "columnsFrom": ["tenant_id"],
3457
- "columnsTo": ["id"],
3655
+ "columnsFrom": [
3656
+ "tenant_id"
3657
+ ],
3658
+ "columnsTo": [
3659
+ "id"
3660
+ ],
3458
3661
  "onDelete": "cascade",
3459
3662
  "onUpdate": "no action"
3460
3663
  }
3461
3664
  },
3462
3665
  "compositePrimaryKeys": {
3463
3666
  "custom_text_tenant_id_prompt_language_pk": {
3464
- "columns": ["tenant_id", "prompt", "language"],
3667
+ "columns": [
3668
+ "tenant_id",
3669
+ "prompt",
3670
+ "language"
3671
+ ],
3465
3672
  "name": "custom_text_tenant_id_prompt_language_pk"
3466
3673
  }
3467
3674
  },
@@ -3585,7 +3792,9 @@
3585
3792
  "indexes": {
3586
3793
  "flows_tenant_id_idx": {
3587
3794
  "name": "flows_tenant_id_idx",
3588
- "columns": ["tenant_id"],
3795
+ "columns": [
3796
+ "tenant_id"
3797
+ ],
3589
3798
  "isUnique": false
3590
3799
  }
3591
3800
  },
@@ -3594,8 +3803,12 @@
3594
3803
  "name": "flows_tenant_id_tenants_id_fk",
3595
3804
  "tableFrom": "flows",
3596
3805
  "tableTo": "tenants",
3597
- "columnsFrom": ["tenant_id"],
3598
- "columnsTo": ["id"],
3806
+ "columnsFrom": [
3807
+ "tenant_id"
3808
+ ],
3809
+ "columnsTo": [
3810
+ "id"
3811
+ ],
3599
3812
  "onDelete": "cascade",
3600
3813
  "onUpdate": "no action"
3601
3814
  }
@@ -3695,7 +3908,9 @@
3695
3908
  "indexes": {
3696
3909
  "forms_tenant_id_idx": {
3697
3910
  "name": "forms_tenant_id_idx",
3698
- "columns": ["tenant_id"],
3911
+ "columns": [
3912
+ "tenant_id"
3913
+ ],
3699
3914
  "isUnique": false
3700
3915
  }
3701
3916
  },
@@ -3704,8 +3919,12 @@
3704
3919
  "name": "forms_tenant_id_tenants_id_fk",
3705
3920
  "tableFrom": "forms",
3706
3921
  "tableTo": "tenants",
3707
- "columnsFrom": ["tenant_id"],
3708
- "columnsTo": ["id"],
3922
+ "columnsFrom": [
3923
+ "tenant_id"
3924
+ ],
3925
+ "columnsTo": [
3926
+ "id"
3927
+ ],
3709
3928
  "onDelete": "cascade",
3710
3929
  "onUpdate": "no action"
3711
3930
  }
@@ -3802,8 +4021,12 @@
3802
4021
  "name": "hooks_tenant_id_tenants_id_fk",
3803
4022
  "tableFrom": "hooks",
3804
4023
  "tableTo": "tenants",
3805
- "columnsFrom": ["tenant_id"],
3806
- "columnsTo": ["id"],
4024
+ "columnsFrom": [
4025
+ "tenant_id"
4026
+ ],
4027
+ "columnsTo": [
4028
+ "id"
4029
+ ],
3807
4030
  "onDelete": "cascade",
3808
4031
  "onUpdate": "no action"
3809
4032
  }
@@ -3907,8 +4130,12 @@
3907
4130
  "name": "keys_tenant_id_tenants_id_fk",
3908
4131
  "tableFrom": "keys",
3909
4132
  "tableTo": "tenants",
3910
- "columnsFrom": ["tenant_id"],
3911
- "columnsTo": ["id"],
4133
+ "columnsFrom": [
4134
+ "tenant_id"
4135
+ ],
4136
+ "columnsTo": [
4137
+ "id"
4138
+ ],
3912
4139
  "onDelete": "cascade",
3913
4140
  "onUpdate": "no action"
3914
4141
  },
@@ -3916,8 +4143,12 @@
3916
4143
  "name": "keys_connection_connections_id_fk",
3917
4144
  "tableFrom": "keys",
3918
4145
  "tableTo": "connections",
3919
- "columnsFrom": ["connection"],
3920
- "columnsTo": ["id"],
4146
+ "columnsFrom": [
4147
+ "connection"
4148
+ ],
4149
+ "columnsTo": [
4150
+ "id"
4151
+ ],
3921
4152
  "onDelete": "cascade",
3922
4153
  "onUpdate": "no action"
3923
4154
  }
@@ -4374,7 +4605,9 @@
4374
4605
  "indexes": {
4375
4606
  "themes_tenant_id_idx": {
4376
4607
  "name": "themes_tenant_id_idx",
4377
- "columns": ["tenant_id"],
4608
+ "columns": [
4609
+ "tenant_id"
4610
+ ],
4378
4611
  "isUnique": false
4379
4612
  }
4380
4613
  },
@@ -4383,15 +4616,22 @@
4383
4616
  "name": "themes_tenant_id_tenants_id_fk",
4384
4617
  "tableFrom": "themes",
4385
4618
  "tableTo": "tenants",
4386
- "columnsFrom": ["tenant_id"],
4387
- "columnsTo": ["id"],
4619
+ "columnsFrom": [
4620
+ "tenant_id"
4621
+ ],
4622
+ "columnsTo": [
4623
+ "id"
4624
+ ],
4388
4625
  "onDelete": "cascade",
4389
4626
  "onUpdate": "no action"
4390
4627
  }
4391
4628
  },
4392
4629
  "compositePrimaryKeys": {
4393
4630
  "themes_pkey": {
4394
- "columns": ["tenant_id", "themeId"],
4631
+ "columns": [
4632
+ "tenant_id",
4633
+ "themeId"
4634
+ ],
4395
4635
  "name": "themes_pkey"
4396
4636
  }
4397
4637
  },
@@ -4436,8 +4676,158 @@
4436
4676
  "name": "universal_login_templates_tenant_id_tenants_id_fk",
4437
4677
  "tableFrom": "universal_login_templates",
4438
4678
  "tableTo": "tenants",
4439
- "columnsFrom": ["tenant_id"],
4440
- "columnsTo": ["id"],
4679
+ "columnsFrom": [
4680
+ "tenant_id"
4681
+ ],
4682
+ "columnsTo": [
4683
+ "id"
4684
+ ],
4685
+ "onDelete": "cascade",
4686
+ "onUpdate": "no action"
4687
+ }
4688
+ },
4689
+ "compositePrimaryKeys": {},
4690
+ "uniqueConstraints": {},
4691
+ "checkConstraints": {}
4692
+ },
4693
+ "authentication_methods": {
4694
+ "name": "authentication_methods",
4695
+ "columns": {
4696
+ "id": {
4697
+ "name": "id",
4698
+ "type": "text(26)",
4699
+ "primaryKey": true,
4700
+ "notNull": true,
4701
+ "autoincrement": false
4702
+ },
4703
+ "tenant_id": {
4704
+ "name": "tenant_id",
4705
+ "type": "text(191)",
4706
+ "primaryKey": false,
4707
+ "notNull": true,
4708
+ "autoincrement": false
4709
+ },
4710
+ "user_id": {
4711
+ "name": "user_id",
4712
+ "type": "text(255)",
4713
+ "primaryKey": false,
4714
+ "notNull": true,
4715
+ "autoincrement": false
4716
+ },
4717
+ "type": {
4718
+ "name": "type",
4719
+ "type": "text(32)",
4720
+ "primaryKey": false,
4721
+ "notNull": true,
4722
+ "autoincrement": false
4723
+ },
4724
+ "phone_number": {
4725
+ "name": "phone_number",
4726
+ "type": "text(32)",
4727
+ "primaryKey": false,
4728
+ "notNull": false,
4729
+ "autoincrement": false
4730
+ },
4731
+ "totp_secret": {
4732
+ "name": "totp_secret",
4733
+ "type": "text(255)",
4734
+ "primaryKey": false,
4735
+ "notNull": false,
4736
+ "autoincrement": false
4737
+ },
4738
+ "credential_id": {
4739
+ "name": "credential_id",
4740
+ "type": "text(512)",
4741
+ "primaryKey": false,
4742
+ "notNull": false,
4743
+ "autoincrement": false
4744
+ },
4745
+ "public_key": {
4746
+ "name": "public_key",
4747
+ "type": "text",
4748
+ "primaryKey": false,
4749
+ "notNull": false,
4750
+ "autoincrement": false
4751
+ },
4752
+ "sign_count": {
4753
+ "name": "sign_count",
4754
+ "type": "integer",
4755
+ "primaryKey": false,
4756
+ "notNull": false,
4757
+ "autoincrement": false
4758
+ },
4759
+ "credential_backed_up": {
4760
+ "name": "credential_backed_up",
4761
+ "type": "integer",
4762
+ "primaryKey": false,
4763
+ "notNull": false,
4764
+ "autoincrement": false
4765
+ },
4766
+ "transports": {
4767
+ "name": "transports",
4768
+ "type": "text(512)",
4769
+ "primaryKey": false,
4770
+ "notNull": false,
4771
+ "autoincrement": false
4772
+ },
4773
+ "friendly_name": {
4774
+ "name": "friendly_name",
4775
+ "type": "text(255)",
4776
+ "primaryKey": false,
4777
+ "notNull": false,
4778
+ "autoincrement": false
4779
+ },
4780
+ "confirmed": {
4781
+ "name": "confirmed",
4782
+ "type": "integer",
4783
+ "primaryKey": false,
4784
+ "notNull": true,
4785
+ "autoincrement": false,
4786
+ "default": 0
4787
+ },
4788
+ "created_at_ts": {
4789
+ "name": "created_at_ts",
4790
+ "type": "integer",
4791
+ "primaryKey": false,
4792
+ "notNull": true,
4793
+ "autoincrement": false
4794
+ },
4795
+ "updated_at_ts": {
4796
+ "name": "updated_at_ts",
4797
+ "type": "integer",
4798
+ "primaryKey": false,
4799
+ "notNull": true,
4800
+ "autoincrement": false
4801
+ }
4802
+ },
4803
+ "indexes": {
4804
+ "authentication_methods_tenant_user_idx": {
4805
+ "name": "authentication_methods_tenant_user_idx",
4806
+ "columns": [
4807
+ "tenant_id",
4808
+ "user_id"
4809
+ ],
4810
+ "isUnique": false
4811
+ },
4812
+ "authentication_methods_credential_id_idx": {
4813
+ "name": "authentication_methods_credential_id_idx",
4814
+ "columns": [
4815
+ "credential_id"
4816
+ ],
4817
+ "isUnique": false
4818
+ }
4819
+ },
4820
+ "foreignKeys": {
4821
+ "authentication_methods_tenant_id_tenants_id_fk": {
4822
+ "name": "authentication_methods_tenant_id_tenants_id_fk",
4823
+ "tableFrom": "authentication_methods",
4824
+ "tableTo": "tenants",
4825
+ "columnsFrom": [
4826
+ "tenant_id"
4827
+ ],
4828
+ "columnsTo": [
4829
+ "id"
4830
+ ],
4441
4831
  "onDelete": "cascade",
4442
4832
  "onUpdate": "no action"
4443
4833
  }
@@ -4656,22 +5046,33 @@
4656
5046
  "indexes": {
4657
5047
  "logs_user_id": {
4658
5048
  "name": "logs_user_id",
4659
- "columns": ["user_id"],
5049
+ "columns": [
5050
+ "user_id"
5051
+ ],
4660
5052
  "isUnique": false
4661
5053
  },
4662
5054
  "logs_tenant_id": {
4663
5055
  "name": "logs_tenant_id",
4664
- "columns": ["tenant_id"],
5056
+ "columns": [
5057
+ "tenant_id"
5058
+ ],
4665
5059
  "isUnique": false
4666
5060
  },
4667
5061
  "logs_date": {
4668
5062
  "name": "logs_date",
4669
- "columns": ["date"],
5063
+ "columns": [
5064
+ "date"
5065
+ ],
4670
5066
  "isUnique": false
4671
5067
  },
4672
5068
  "IDX_logs_tenant_date_type_user": {
4673
5069
  "name": "IDX_logs_tenant_date_type_user",
4674
- "columns": ["tenant_id", "date", "type", "user_id"],
5070
+ "columns": [
5071
+ "tenant_id",
5072
+ "date",
5073
+ "type",
5074
+ "user_id"
5075
+ ],
4675
5076
  "isUnique": false
4676
5077
  }
4677
5078
  },
@@ -4679,6 +5080,151 @@
4679
5080
  "compositePrimaryKeys": {},
4680
5081
  "uniqueConstraints": {},
4681
5082
  "checkConstraints": {}
5083
+ },
5084
+ "outbox_events": {
5085
+ "name": "outbox_events",
5086
+ "columns": {
5087
+ "id": {
5088
+ "name": "id",
5089
+ "type": "text(26)",
5090
+ "primaryKey": true,
5091
+ "notNull": true,
5092
+ "autoincrement": false
5093
+ },
5094
+ "tenant_id": {
5095
+ "name": "tenant_id",
5096
+ "type": "text(191)",
5097
+ "primaryKey": false,
5098
+ "notNull": true,
5099
+ "autoincrement": false
5100
+ },
5101
+ "event_type": {
5102
+ "name": "event_type",
5103
+ "type": "text(64)",
5104
+ "primaryKey": false,
5105
+ "notNull": true,
5106
+ "autoincrement": false
5107
+ },
5108
+ "log_type": {
5109
+ "name": "log_type",
5110
+ "type": "text(64)",
5111
+ "primaryKey": false,
5112
+ "notNull": true,
5113
+ "autoincrement": false
5114
+ },
5115
+ "aggregate_type": {
5116
+ "name": "aggregate_type",
5117
+ "type": "text(64)",
5118
+ "primaryKey": false,
5119
+ "notNull": true,
5120
+ "autoincrement": false
5121
+ },
5122
+ "aggregate_id": {
5123
+ "name": "aggregate_id",
5124
+ "type": "text(255)",
5125
+ "primaryKey": false,
5126
+ "notNull": true,
5127
+ "autoincrement": false
5128
+ },
5129
+ "payload": {
5130
+ "name": "payload",
5131
+ "type": "text",
5132
+ "primaryKey": false,
5133
+ "notNull": true,
5134
+ "autoincrement": false
5135
+ },
5136
+ "created_at": {
5137
+ "name": "created_at",
5138
+ "type": "text(35)",
5139
+ "primaryKey": false,
5140
+ "notNull": true,
5141
+ "autoincrement": false
5142
+ },
5143
+ "processed_at": {
5144
+ "name": "processed_at",
5145
+ "type": "text(35)",
5146
+ "primaryKey": false,
5147
+ "notNull": false,
5148
+ "autoincrement": false
5149
+ },
5150
+ "retry_count": {
5151
+ "name": "retry_count",
5152
+ "type": "integer",
5153
+ "primaryKey": false,
5154
+ "notNull": true,
5155
+ "autoincrement": false,
5156
+ "default": 0
5157
+ },
5158
+ "next_retry_at": {
5159
+ "name": "next_retry_at",
5160
+ "type": "text(35)",
5161
+ "primaryKey": false,
5162
+ "notNull": false,
5163
+ "autoincrement": false
5164
+ },
5165
+ "error": {
5166
+ "name": "error",
5167
+ "type": "text",
5168
+ "primaryKey": false,
5169
+ "notNull": false,
5170
+ "autoincrement": false
5171
+ },
5172
+ "claimed_by": {
5173
+ "name": "claimed_by",
5174
+ "type": "text(255)",
5175
+ "primaryKey": false,
5176
+ "notNull": false,
5177
+ "autoincrement": false
5178
+ },
5179
+ "claim_expires_at": {
5180
+ "name": "claim_expires_at",
5181
+ "type": "text(35)",
5182
+ "primaryKey": false,
5183
+ "notNull": false,
5184
+ "autoincrement": false
5185
+ }
5186
+ },
5187
+ "indexes": {
5188
+ "idx_outbox_events_tenant_id": {
5189
+ "name": "idx_outbox_events_tenant_id",
5190
+ "columns": [
5191
+ "tenant_id"
5192
+ ],
5193
+ "isUnique": false
5194
+ },
5195
+ "idx_outbox_events_processed_at": {
5196
+ "name": "idx_outbox_events_processed_at",
5197
+ "columns": [
5198
+ "processed_at"
5199
+ ],
5200
+ "isUnique": false
5201
+ },
5202
+ "idx_outbox_events_claimed_by": {
5203
+ "name": "idx_outbox_events_claimed_by",
5204
+ "columns": [
5205
+ "claimed_by"
5206
+ ],
5207
+ "isUnique": false
5208
+ }
5209
+ },
5210
+ "foreignKeys": {
5211
+ "outbox_events_tenant_id_tenants_id_fk": {
5212
+ "name": "outbox_events_tenant_id_tenants_id_fk",
5213
+ "tableFrom": "outbox_events",
5214
+ "tableTo": "tenants",
5215
+ "columnsFrom": [
5216
+ "tenant_id"
5217
+ ],
5218
+ "columnsTo": [
5219
+ "id"
5220
+ ],
5221
+ "onDelete": "cascade",
5222
+ "onUpdate": "no action"
5223
+ }
5224
+ },
5225
+ "compositePrimaryKeys": {},
5226
+ "uniqueConstraints": {},
5227
+ "checkConstraints": {}
4682
5228
  }
4683
5229
  },
4684
5230
  "views": {},
@@ -4691,4 +5237,4 @@
4691
5237
  "internal": {
4692
5238
  "indexes": {}
4693
5239
  }
4694
- }
5240
+ }