create-fullstack-scaffold 0.5.7 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/cli/index.js +65 -2
  2. package/dist/cli/index.js.map +1 -1
  3. package/package.json +12 -12
  4. package/template/CLAUDE.md +3 -3
  5. package/template/PROJECT_SUMMARY.md +1 -1
  6. package/template/QUICKSTART.md +3 -3
  7. package/template/README.md +2 -2
  8. package/template/drizzle/0000_init_full_schema.sql +390 -0
  9. package/template/drizzle/meta/0000_snapshot.json +2487 -0
  10. package/template/drizzle/meta/_journal.json +13 -0
  11. package/template/package.json +10 -10
  12. package/template/src/cli/modules/tenant/index.ts +89 -0
  13. package/template/src/server/db/init.ts +0 -52
  14. package/template/src/server/db/schema/index.ts +3 -0
  15. package/template/src/server/db/schema/tenant-invitations.ts +33 -0
  16. package/template/src/server/db/schema/tenant-members.ts +38 -0
  17. package/template/src/server/db/schema/tenant-roles.ts +32 -0
  18. package/template/src/server/db/schema/todos.ts +4 -0
  19. package/template/src/server/db/test-setup.ts +128 -0
  20. package/template/src/server/entries/node.ts +13 -0
  21. package/template/src/server/index.ts +12 -0
  22. package/template/src/server/middleware/__tests__/tenant-isolation.test.ts +55 -9
  23. package/template/src/server/middleware/auth.ts +17 -19
  24. package/template/src/server/middleware/tenant-isolation.ts +4 -2
  25. package/template/src/server/module-auth/module.ts +2 -1
  26. package/template/src/server/module-auth/services/auth-service.ts +39 -0
  27. package/template/src/server/module-tenant/__tests__/tenant-routes.test.ts +97 -0
  28. package/template/src/server/module-tenant/__tests__/tenant-service.test.ts +201 -22
  29. package/template/src/server/module-tenant/module.ts +1 -1
  30. package/template/src/server/module-tenant/routes/tenant-routes.ts +339 -2
  31. package/template/src/server/module-tenant/services/tenant-service.ts +581 -17
  32. package/template/src/server/module-todos/routes/todos-routes.ts +10 -2
  33. package/template/src/server/module-todos/services/todo-service.ts +12 -2
  34. package/template/src/server/utils/__tests__/captcha.test.ts +6 -4
  35. package/template/src/server/utils/id-helpers.ts +13 -0
  36. package/template/src/shared/modules/index.ts +29 -6
  37. package/template/src/shared/modules/tenant/index.ts +30 -0
  38. package/template/src/shared/modules/tenant/permissions.ts +54 -0
  39. package/template/src/shared/modules/tenant/role-templates.ts +66 -0
  40. package/template/src/shared/modules/tenant/schemas.ts +113 -1
  41. package/template/src/shared/modules/todos/schemas.ts +1 -0
  42. package/template/src/shared/schemas/index.ts +28 -0
  43. package/template/src/tenant/App.tsx +30 -23
  44. package/template/src/tenant/components/TenantGuard.tsx +12 -2
  45. package/template/src/tenant/layouts/Header.tsx +6 -2
  46. package/template/src/tenant/pages/InviteAcceptPage.tsx +97 -0
  47. package/template/src/tenant/pages/LoginPage.tsx +82 -0
  48. package/template/src/tenant/pages/SubscriptionPage.tsx +32 -55
  49. package/template/src/tenant/pages/UsersPage.tsx +134 -88
  50. package/template/src/tenant/services/tenantApi.ts +61 -0
  51. package/template/src/tenant/stores/tenantStore.ts +172 -49
  52. package/template/src/test/setup-db-path.ts +20 -0
  53. package/template/vitest.config.ts +3 -1
@@ -0,0 +1,2487 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "76b50b5c-1553-4b97-9609-a78a52dd8e8a",
5
+ "prevId": "00000000-0000-0000-0000-000000000000",
6
+ "tables": {
7
+ "todos": {
8
+ "name": "todos",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "integer",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": true
16
+ },
17
+ "tenant_id": {
18
+ "name": "tenant_id",
19
+ "type": "integer",
20
+ "primaryKey": false,
21
+ "notNull": false,
22
+ "autoincrement": false
23
+ },
24
+ "title": {
25
+ "name": "title",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "description": {
32
+ "name": "description",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": false,
36
+ "autoincrement": false
37
+ },
38
+ "status": {
39
+ "name": "status",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": true,
43
+ "autoincrement": false,
44
+ "default": "'pending'"
45
+ },
46
+ "created_at": {
47
+ "name": "created_at",
48
+ "type": "integer",
49
+ "primaryKey": false,
50
+ "notNull": true,
51
+ "autoincrement": false,
52
+ "default": "(unixepoch() * 1000)"
53
+ },
54
+ "updated_at": {
55
+ "name": "updated_at",
56
+ "type": "integer",
57
+ "primaryKey": false,
58
+ "notNull": true,
59
+ "autoincrement": false,
60
+ "default": "(unixepoch() * 1000)"
61
+ }
62
+ },
63
+ "indexes": {
64
+ "todos_status_idx": {
65
+ "name": "todos_status_idx",
66
+ "columns": ["status"],
67
+ "isUnique": false
68
+ },
69
+ "todos_tenant_idx": {
70
+ "name": "todos_tenant_idx",
71
+ "columns": ["tenant_id"],
72
+ "isUnique": false
73
+ },
74
+ "todos_created_at_idx": {
75
+ "name": "todos_created_at_idx",
76
+ "columns": ["created_at"],
77
+ "isUnique": false
78
+ },
79
+ "todos_updated_at_idx": {
80
+ "name": "todos_updated_at_idx",
81
+ "columns": ["updated_at"],
82
+ "isUnique": false
83
+ }
84
+ },
85
+ "foreignKeys": {},
86
+ "compositePrimaryKeys": {},
87
+ "uniqueConstraints": {},
88
+ "checkConstraints": {}
89
+ },
90
+ "todo_attachments": {
91
+ "name": "todo_attachments",
92
+ "columns": {
93
+ "id": {
94
+ "name": "id",
95
+ "type": "integer",
96
+ "primaryKey": true,
97
+ "notNull": true,
98
+ "autoincrement": true
99
+ },
100
+ "todo_id": {
101
+ "name": "todo_id",
102
+ "type": "integer",
103
+ "primaryKey": false,
104
+ "notNull": true,
105
+ "autoincrement": false
106
+ },
107
+ "file_name": {
108
+ "name": "file_name",
109
+ "type": "text",
110
+ "primaryKey": false,
111
+ "notNull": true,
112
+ "autoincrement": false
113
+ },
114
+ "original_name": {
115
+ "name": "original_name",
116
+ "type": "text",
117
+ "primaryKey": false,
118
+ "notNull": true,
119
+ "autoincrement": false
120
+ },
121
+ "mime_type": {
122
+ "name": "mime_type",
123
+ "type": "text",
124
+ "primaryKey": false,
125
+ "notNull": true,
126
+ "autoincrement": false
127
+ },
128
+ "size": {
129
+ "name": "size",
130
+ "type": "integer",
131
+ "primaryKey": false,
132
+ "notNull": true,
133
+ "autoincrement": false
134
+ },
135
+ "path": {
136
+ "name": "path",
137
+ "type": "text",
138
+ "primaryKey": false,
139
+ "notNull": true,
140
+ "autoincrement": false
141
+ },
142
+ "uploaded_by": {
143
+ "name": "uploaded_by",
144
+ "type": "text",
145
+ "primaryKey": false,
146
+ "notNull": false,
147
+ "autoincrement": false
148
+ },
149
+ "created_at": {
150
+ "name": "created_at",
151
+ "type": "integer",
152
+ "primaryKey": false,
153
+ "notNull": true,
154
+ "autoincrement": false,
155
+ "default": "(unixepoch() * 1000)"
156
+ }
157
+ },
158
+ "indexes": {},
159
+ "foreignKeys": {
160
+ "todo_attachments_todo_id_todos_id_fk": {
161
+ "name": "todo_attachments_todo_id_todos_id_fk",
162
+ "tableFrom": "todo_attachments",
163
+ "tableTo": "todos",
164
+ "columnsFrom": ["todo_id"],
165
+ "columnsTo": ["id"],
166
+ "onDelete": "cascade",
167
+ "onUpdate": "no action"
168
+ }
169
+ },
170
+ "compositePrimaryKeys": {},
171
+ "uniqueConstraints": {},
172
+ "checkConstraints": {}
173
+ },
174
+ "notifications": {
175
+ "name": "notifications",
176
+ "columns": {
177
+ "id": {
178
+ "name": "id",
179
+ "type": "text",
180
+ "primaryKey": true,
181
+ "notNull": true,
182
+ "autoincrement": false
183
+ },
184
+ "type": {
185
+ "name": "type",
186
+ "type": "text",
187
+ "primaryKey": false,
188
+ "notNull": true,
189
+ "autoincrement": false
190
+ },
191
+ "title": {
192
+ "name": "title",
193
+ "type": "text",
194
+ "primaryKey": false,
195
+ "notNull": true,
196
+ "autoincrement": false
197
+ },
198
+ "message": {
199
+ "name": "message",
200
+ "type": "text",
201
+ "primaryKey": false,
202
+ "notNull": true,
203
+ "autoincrement": false
204
+ },
205
+ "read": {
206
+ "name": "read",
207
+ "type": "integer",
208
+ "primaryKey": false,
209
+ "notNull": true,
210
+ "autoincrement": false,
211
+ "default": false
212
+ },
213
+ "created_at": {
214
+ "name": "created_at",
215
+ "type": "integer",
216
+ "primaryKey": false,
217
+ "notNull": true,
218
+ "autoincrement": false,
219
+ "default": "(unixepoch() * 1000)"
220
+ }
221
+ },
222
+ "indexes": {
223
+ "notifications_created_at_idx": {
224
+ "name": "notifications_created_at_idx",
225
+ "columns": ["created_at"],
226
+ "isUnique": false
227
+ }
228
+ },
229
+ "foreignKeys": {},
230
+ "compositePrimaryKeys": {},
231
+ "uniqueConstraints": {},
232
+ "checkConstraints": {}
233
+ },
234
+ "permissions": {
235
+ "name": "permissions",
236
+ "columns": {
237
+ "id": {
238
+ "name": "id",
239
+ "type": "text",
240
+ "primaryKey": true,
241
+ "notNull": true,
242
+ "autoincrement": false
243
+ },
244
+ "code": {
245
+ "name": "code",
246
+ "type": "text",
247
+ "primaryKey": false,
248
+ "notNull": true,
249
+ "autoincrement": false
250
+ },
251
+ "name": {
252
+ "name": "name",
253
+ "type": "text",
254
+ "primaryKey": false,
255
+ "notNull": true,
256
+ "autoincrement": false
257
+ },
258
+ "label": {
259
+ "name": "label",
260
+ "type": "text",
261
+ "primaryKey": false,
262
+ "notNull": true,
263
+ "autoincrement": false
264
+ },
265
+ "category": {
266
+ "name": "category",
267
+ "type": "text",
268
+ "primaryKey": false,
269
+ "notNull": true,
270
+ "autoincrement": false
271
+ },
272
+ "description": {
273
+ "name": "description",
274
+ "type": "text",
275
+ "primaryKey": false,
276
+ "notNull": false,
277
+ "autoincrement": false
278
+ },
279
+ "sort_order": {
280
+ "name": "sort_order",
281
+ "type": "integer",
282
+ "primaryKey": false,
283
+ "notNull": false,
284
+ "autoincrement": false,
285
+ "default": 0
286
+ },
287
+ "is_active": {
288
+ "name": "is_active",
289
+ "type": "integer",
290
+ "primaryKey": false,
291
+ "notNull": false,
292
+ "autoincrement": false,
293
+ "default": true
294
+ },
295
+ "created_at": {
296
+ "name": "created_at",
297
+ "type": "integer",
298
+ "primaryKey": false,
299
+ "notNull": false,
300
+ "autoincrement": false
301
+ },
302
+ "updated_at": {
303
+ "name": "updated_at",
304
+ "type": "integer",
305
+ "primaryKey": false,
306
+ "notNull": false,
307
+ "autoincrement": false
308
+ }
309
+ },
310
+ "indexes": {
311
+ "permissions_code_unique": {
312
+ "name": "permissions_code_unique",
313
+ "columns": ["code"],
314
+ "isUnique": true
315
+ }
316
+ },
317
+ "foreignKeys": {},
318
+ "compositePrimaryKeys": {},
319
+ "uniqueConstraints": {},
320
+ "checkConstraints": {}
321
+ },
322
+ "roles": {
323
+ "name": "roles",
324
+ "columns": {
325
+ "id": {
326
+ "name": "id",
327
+ "type": "text",
328
+ "primaryKey": true,
329
+ "notNull": true,
330
+ "autoincrement": false
331
+ },
332
+ "code": {
333
+ "name": "code",
334
+ "type": "text",
335
+ "primaryKey": false,
336
+ "notNull": true,
337
+ "autoincrement": false
338
+ },
339
+ "name": {
340
+ "name": "name",
341
+ "type": "text",
342
+ "primaryKey": false,
343
+ "notNull": true,
344
+ "autoincrement": false
345
+ },
346
+ "label": {
347
+ "name": "label",
348
+ "type": "text",
349
+ "primaryKey": false,
350
+ "notNull": true,
351
+ "autoincrement": false
352
+ },
353
+ "description": {
354
+ "name": "description",
355
+ "type": "text",
356
+ "primaryKey": false,
357
+ "notNull": false,
358
+ "autoincrement": false
359
+ },
360
+ "is_system": {
361
+ "name": "is_system",
362
+ "type": "integer",
363
+ "primaryKey": false,
364
+ "notNull": false,
365
+ "autoincrement": false,
366
+ "default": false
367
+ },
368
+ "is_active": {
369
+ "name": "is_active",
370
+ "type": "integer",
371
+ "primaryKey": false,
372
+ "notNull": false,
373
+ "autoincrement": false,
374
+ "default": true
375
+ },
376
+ "sort_order": {
377
+ "name": "sort_order",
378
+ "type": "integer",
379
+ "primaryKey": false,
380
+ "notNull": false,
381
+ "autoincrement": false,
382
+ "default": 0
383
+ },
384
+ "created_at": {
385
+ "name": "created_at",
386
+ "type": "integer",
387
+ "primaryKey": false,
388
+ "notNull": false,
389
+ "autoincrement": false
390
+ },
391
+ "updated_at": {
392
+ "name": "updated_at",
393
+ "type": "integer",
394
+ "primaryKey": false,
395
+ "notNull": false,
396
+ "autoincrement": false
397
+ }
398
+ },
399
+ "indexes": {
400
+ "roles_code_unique": {
401
+ "name": "roles_code_unique",
402
+ "columns": ["code"],
403
+ "isUnique": true
404
+ }
405
+ },
406
+ "foreignKeys": {},
407
+ "compositePrimaryKeys": {},
408
+ "uniqueConstraints": {},
409
+ "checkConstraints": {}
410
+ },
411
+ "role_permissions": {
412
+ "name": "role_permissions",
413
+ "columns": {
414
+ "role_id": {
415
+ "name": "role_id",
416
+ "type": "text",
417
+ "primaryKey": false,
418
+ "notNull": true,
419
+ "autoincrement": false
420
+ },
421
+ "permission_id": {
422
+ "name": "permission_id",
423
+ "type": "text",
424
+ "primaryKey": false,
425
+ "notNull": true,
426
+ "autoincrement": false
427
+ },
428
+ "created_at": {
429
+ "name": "created_at",
430
+ "type": "integer",
431
+ "primaryKey": false,
432
+ "notNull": false,
433
+ "autoincrement": false
434
+ }
435
+ },
436
+ "indexes": {},
437
+ "foreignKeys": {
438
+ "role_permissions_role_id_roles_id_fk": {
439
+ "name": "role_permissions_role_id_roles_id_fk",
440
+ "tableFrom": "role_permissions",
441
+ "tableTo": "roles",
442
+ "columnsFrom": ["role_id"],
443
+ "columnsTo": ["id"],
444
+ "onDelete": "cascade",
445
+ "onUpdate": "no action"
446
+ },
447
+ "role_permissions_permission_id_permissions_id_fk": {
448
+ "name": "role_permissions_permission_id_permissions_id_fk",
449
+ "tableFrom": "role_permissions",
450
+ "tableTo": "permissions",
451
+ "columnsFrom": ["permission_id"],
452
+ "columnsTo": ["id"],
453
+ "onDelete": "cascade",
454
+ "onUpdate": "no action"
455
+ }
456
+ },
457
+ "compositePrimaryKeys": {
458
+ "role_permissions_role_id_permission_id_pk": {
459
+ "columns": ["role_id", "permission_id"],
460
+ "name": "role_permissions_role_id_permission_id_pk"
461
+ }
462
+ },
463
+ "uniqueConstraints": {},
464
+ "checkConstraints": {}
465
+ },
466
+ "user_roles": {
467
+ "name": "user_roles",
468
+ "columns": {
469
+ "id": {
470
+ "name": "id",
471
+ "type": "text",
472
+ "primaryKey": true,
473
+ "notNull": true,
474
+ "autoincrement": false
475
+ },
476
+ "user_id": {
477
+ "name": "user_id",
478
+ "type": "text",
479
+ "primaryKey": false,
480
+ "notNull": true,
481
+ "autoincrement": false
482
+ },
483
+ "role_id": {
484
+ "name": "role_id",
485
+ "type": "text",
486
+ "primaryKey": false,
487
+ "notNull": true,
488
+ "autoincrement": false
489
+ },
490
+ "assigned_by": {
491
+ "name": "assigned_by",
492
+ "type": "text",
493
+ "primaryKey": false,
494
+ "notNull": false,
495
+ "autoincrement": false
496
+ },
497
+ "assigned_at": {
498
+ "name": "assigned_at",
499
+ "type": "integer",
500
+ "primaryKey": false,
501
+ "notNull": false,
502
+ "autoincrement": false
503
+ },
504
+ "expires_at": {
505
+ "name": "expires_at",
506
+ "type": "integer",
507
+ "primaryKey": false,
508
+ "notNull": false,
509
+ "autoincrement": false
510
+ },
511
+ "is_active": {
512
+ "name": "is_active",
513
+ "type": "integer",
514
+ "primaryKey": false,
515
+ "notNull": false,
516
+ "autoincrement": false,
517
+ "default": true
518
+ }
519
+ },
520
+ "indexes": {},
521
+ "foreignKeys": {
522
+ "user_roles_role_id_roles_id_fk": {
523
+ "name": "user_roles_role_id_roles_id_fk",
524
+ "tableFrom": "user_roles",
525
+ "tableTo": "roles",
526
+ "columnsFrom": ["role_id"],
527
+ "columnsTo": ["id"],
528
+ "onDelete": "cascade",
529
+ "onUpdate": "no action"
530
+ }
531
+ },
532
+ "compositePrimaryKeys": {},
533
+ "uniqueConstraints": {},
534
+ "checkConstraints": {}
535
+ },
536
+ "routes": {
537
+ "name": "routes",
538
+ "columns": {
539
+ "id": {
540
+ "name": "id",
541
+ "type": "text",
542
+ "primaryKey": true,
543
+ "notNull": true,
544
+ "autoincrement": false
545
+ },
546
+ "path": {
547
+ "name": "path",
548
+ "type": "text",
549
+ "primaryKey": false,
550
+ "notNull": true,
551
+ "autoincrement": false
552
+ },
553
+ "method": {
554
+ "name": "method",
555
+ "type": "text",
556
+ "primaryKey": false,
557
+ "notNull": true,
558
+ "autoincrement": false
559
+ },
560
+ "name": {
561
+ "name": "name",
562
+ "type": "text",
563
+ "primaryKey": false,
564
+ "notNull": false,
565
+ "autoincrement": false
566
+ },
567
+ "description": {
568
+ "name": "description",
569
+ "type": "text",
570
+ "primaryKey": false,
571
+ "notNull": false,
572
+ "autoincrement": false
573
+ },
574
+ "module": {
575
+ "name": "module",
576
+ "type": "text",
577
+ "primaryKey": false,
578
+ "notNull": false,
579
+ "autoincrement": false
580
+ },
581
+ "is_public": {
582
+ "name": "is_public",
583
+ "type": "integer",
584
+ "primaryKey": false,
585
+ "notNull": false,
586
+ "autoincrement": false,
587
+ "default": false
588
+ },
589
+ "is_active": {
590
+ "name": "is_active",
591
+ "type": "integer",
592
+ "primaryKey": false,
593
+ "notNull": false,
594
+ "autoincrement": false,
595
+ "default": true
596
+ },
597
+ "created_at": {
598
+ "name": "created_at",
599
+ "type": "integer",
600
+ "primaryKey": false,
601
+ "notNull": false,
602
+ "autoincrement": false
603
+ },
604
+ "updated_at": {
605
+ "name": "updated_at",
606
+ "type": "integer",
607
+ "primaryKey": false,
608
+ "notNull": false,
609
+ "autoincrement": false
610
+ }
611
+ },
612
+ "indexes": {
613
+ "routes_path_method_unique": {
614
+ "name": "routes_path_method_unique",
615
+ "columns": ["path", "method"],
616
+ "isUnique": true
617
+ }
618
+ },
619
+ "foreignKeys": {},
620
+ "compositePrimaryKeys": {},
621
+ "uniqueConstraints": {},
622
+ "checkConstraints": {}
623
+ },
624
+ "permission_routes": {
625
+ "name": "permission_routes",
626
+ "columns": {
627
+ "permission_id": {
628
+ "name": "permission_id",
629
+ "type": "text",
630
+ "primaryKey": false,
631
+ "notNull": true,
632
+ "autoincrement": false
633
+ },
634
+ "route_id": {
635
+ "name": "route_id",
636
+ "type": "text",
637
+ "primaryKey": false,
638
+ "notNull": true,
639
+ "autoincrement": false
640
+ },
641
+ "created_at": {
642
+ "name": "created_at",
643
+ "type": "integer",
644
+ "primaryKey": false,
645
+ "notNull": false,
646
+ "autoincrement": false
647
+ }
648
+ },
649
+ "indexes": {},
650
+ "foreignKeys": {
651
+ "permission_routes_permission_id_permissions_id_fk": {
652
+ "name": "permission_routes_permission_id_permissions_id_fk",
653
+ "tableFrom": "permission_routes",
654
+ "tableTo": "permissions",
655
+ "columnsFrom": ["permission_id"],
656
+ "columnsTo": ["id"],
657
+ "onDelete": "cascade",
658
+ "onUpdate": "no action"
659
+ },
660
+ "permission_routes_route_id_routes_id_fk": {
661
+ "name": "permission_routes_route_id_routes_id_fk",
662
+ "tableFrom": "permission_routes",
663
+ "tableTo": "routes",
664
+ "columnsFrom": ["route_id"],
665
+ "columnsTo": ["id"],
666
+ "onDelete": "cascade",
667
+ "onUpdate": "no action"
668
+ }
669
+ },
670
+ "compositePrimaryKeys": {
671
+ "permission_routes_permission_id_route_id_pk": {
672
+ "columns": ["permission_id", "route_id"],
673
+ "name": "permission_routes_permission_id_route_id_pk"
674
+ }
675
+ },
676
+ "uniqueConstraints": {},
677
+ "checkConstraints": {}
678
+ },
679
+ "permission_audit_logs": {
680
+ "name": "permission_audit_logs",
681
+ "columns": {
682
+ "id": {
683
+ "name": "id",
684
+ "type": "text",
685
+ "primaryKey": true,
686
+ "notNull": true,
687
+ "autoincrement": false
688
+ },
689
+ "user_id": {
690
+ "name": "user_id",
691
+ "type": "text",
692
+ "primaryKey": false,
693
+ "notNull": true,
694
+ "autoincrement": false
695
+ },
696
+ "action": {
697
+ "name": "action",
698
+ "type": "text",
699
+ "primaryKey": false,
700
+ "notNull": true,
701
+ "autoincrement": false
702
+ },
703
+ "resource_type": {
704
+ "name": "resource_type",
705
+ "type": "text",
706
+ "primaryKey": false,
707
+ "notNull": true,
708
+ "autoincrement": false
709
+ },
710
+ "resource_id": {
711
+ "name": "resource_id",
712
+ "type": "text",
713
+ "primaryKey": false,
714
+ "notNull": false,
715
+ "autoincrement": false
716
+ },
717
+ "old_value": {
718
+ "name": "old_value",
719
+ "type": "text",
720
+ "primaryKey": false,
721
+ "notNull": false,
722
+ "autoincrement": false
723
+ },
724
+ "new_value": {
725
+ "name": "new_value",
726
+ "type": "text",
727
+ "primaryKey": false,
728
+ "notNull": false,
729
+ "autoincrement": false
730
+ },
731
+ "ip_address": {
732
+ "name": "ip_address",
733
+ "type": "text",
734
+ "primaryKey": false,
735
+ "notNull": false,
736
+ "autoincrement": false
737
+ },
738
+ "user_agent": {
739
+ "name": "user_agent",
740
+ "type": "text",
741
+ "primaryKey": false,
742
+ "notNull": false,
743
+ "autoincrement": false
744
+ },
745
+ "created_at": {
746
+ "name": "created_at",
747
+ "type": "integer",
748
+ "primaryKey": false,
749
+ "notNull": false,
750
+ "autoincrement": false
751
+ }
752
+ },
753
+ "indexes": {},
754
+ "foreignKeys": {},
755
+ "compositePrimaryKeys": {},
756
+ "uniqueConstraints": {},
757
+ "checkConstraints": {}
758
+ },
759
+ "orders": {
760
+ "name": "orders",
761
+ "columns": {
762
+ "id": {
763
+ "name": "id",
764
+ "type": "integer",
765
+ "primaryKey": true,
766
+ "notNull": true,
767
+ "autoincrement": true
768
+ },
769
+ "order_no": {
770
+ "name": "order_no",
771
+ "type": "text",
772
+ "primaryKey": false,
773
+ "notNull": true,
774
+ "autoincrement": false
775
+ },
776
+ "customer_name": {
777
+ "name": "customer_name",
778
+ "type": "text",
779
+ "primaryKey": false,
780
+ "notNull": true,
781
+ "autoincrement": false
782
+ },
783
+ "customer_email": {
784
+ "name": "customer_email",
785
+ "type": "text",
786
+ "primaryKey": false,
787
+ "notNull": true,
788
+ "autoincrement": false
789
+ },
790
+ "product_name": {
791
+ "name": "product_name",
792
+ "type": "text",
793
+ "primaryKey": false,
794
+ "notNull": true,
795
+ "autoincrement": false
796
+ },
797
+ "amount": {
798
+ "name": "amount",
799
+ "type": "integer",
800
+ "primaryKey": false,
801
+ "notNull": true,
802
+ "autoincrement": false
803
+ },
804
+ "status": {
805
+ "name": "status",
806
+ "type": "text",
807
+ "primaryKey": false,
808
+ "notNull": true,
809
+ "autoincrement": false,
810
+ "default": "'pending'"
811
+ },
812
+ "created_at": {
813
+ "name": "created_at",
814
+ "type": "integer",
815
+ "primaryKey": false,
816
+ "notNull": true,
817
+ "autoincrement": false,
818
+ "default": "(unixepoch() * 1000)"
819
+ },
820
+ "updated_at": {
821
+ "name": "updated_at",
822
+ "type": "integer",
823
+ "primaryKey": false,
824
+ "notNull": true,
825
+ "autoincrement": false,
826
+ "default": "(unixepoch() * 1000)"
827
+ }
828
+ },
829
+ "indexes": {
830
+ "orders_status_idx": {
831
+ "name": "orders_status_idx",
832
+ "columns": ["status"],
833
+ "isUnique": false
834
+ },
835
+ "orders_created_at_idx": {
836
+ "name": "orders_created_at_idx",
837
+ "columns": ["created_at"],
838
+ "isUnique": false
839
+ }
840
+ },
841
+ "foreignKeys": {},
842
+ "compositePrimaryKeys": {},
843
+ "uniqueConstraints": {},
844
+ "checkConstraints": {}
845
+ },
846
+ "ticket_replies": {
847
+ "name": "ticket_replies",
848
+ "columns": {
849
+ "id": {
850
+ "name": "id",
851
+ "type": "integer",
852
+ "primaryKey": true,
853
+ "notNull": true,
854
+ "autoincrement": true
855
+ },
856
+ "ticket_id": {
857
+ "name": "ticket_id",
858
+ "type": "integer",
859
+ "primaryKey": false,
860
+ "notNull": true,
861
+ "autoincrement": false
862
+ },
863
+ "content": {
864
+ "name": "content",
865
+ "type": "text",
866
+ "primaryKey": false,
867
+ "notNull": true,
868
+ "autoincrement": false
869
+ },
870
+ "author": {
871
+ "name": "author",
872
+ "type": "text",
873
+ "primaryKey": false,
874
+ "notNull": true,
875
+ "autoincrement": false
876
+ },
877
+ "is_customer": {
878
+ "name": "is_customer",
879
+ "type": "integer",
880
+ "primaryKey": false,
881
+ "notNull": true,
882
+ "autoincrement": false,
883
+ "default": false
884
+ },
885
+ "created_at": {
886
+ "name": "created_at",
887
+ "type": "integer",
888
+ "primaryKey": false,
889
+ "notNull": true,
890
+ "autoincrement": false,
891
+ "default": "(unixepoch() * 1000)"
892
+ }
893
+ },
894
+ "indexes": {
895
+ "ticket_replies_ticket_id_idx": {
896
+ "name": "ticket_replies_ticket_id_idx",
897
+ "columns": ["ticket_id"],
898
+ "isUnique": false
899
+ }
900
+ },
901
+ "foreignKeys": {
902
+ "ticket_replies_ticket_id_tickets_id_fk": {
903
+ "name": "ticket_replies_ticket_id_tickets_id_fk",
904
+ "tableFrom": "ticket_replies",
905
+ "tableTo": "tickets",
906
+ "columnsFrom": ["ticket_id"],
907
+ "columnsTo": ["id"],
908
+ "onDelete": "cascade",
909
+ "onUpdate": "no action"
910
+ }
911
+ },
912
+ "compositePrimaryKeys": {},
913
+ "uniqueConstraints": {},
914
+ "checkConstraints": {}
915
+ },
916
+ "tickets": {
917
+ "name": "tickets",
918
+ "columns": {
919
+ "id": {
920
+ "name": "id",
921
+ "type": "integer",
922
+ "primaryKey": true,
923
+ "notNull": true,
924
+ "autoincrement": true
925
+ },
926
+ "ticket_no": {
927
+ "name": "ticket_no",
928
+ "type": "text",
929
+ "primaryKey": false,
930
+ "notNull": true,
931
+ "autoincrement": false
932
+ },
933
+ "customer_name": {
934
+ "name": "customer_name",
935
+ "type": "text",
936
+ "primaryKey": false,
937
+ "notNull": true,
938
+ "autoincrement": false
939
+ },
940
+ "customer_email": {
941
+ "name": "customer_email",
942
+ "type": "text",
943
+ "primaryKey": false,
944
+ "notNull": true,
945
+ "autoincrement": false
946
+ },
947
+ "subject": {
948
+ "name": "subject",
949
+ "type": "text",
950
+ "primaryKey": false,
951
+ "notNull": true,
952
+ "autoincrement": false
953
+ },
954
+ "description": {
955
+ "name": "description",
956
+ "type": "text",
957
+ "primaryKey": false,
958
+ "notNull": true,
959
+ "autoincrement": false
960
+ },
961
+ "status": {
962
+ "name": "status",
963
+ "type": "text",
964
+ "primaryKey": false,
965
+ "notNull": true,
966
+ "autoincrement": false,
967
+ "default": "'open'"
968
+ },
969
+ "priority": {
970
+ "name": "priority",
971
+ "type": "text",
972
+ "primaryKey": false,
973
+ "notNull": true,
974
+ "autoincrement": false,
975
+ "default": "'medium'"
976
+ },
977
+ "category": {
978
+ "name": "category",
979
+ "type": "text",
980
+ "primaryKey": false,
981
+ "notNull": true,
982
+ "autoincrement": false
983
+ },
984
+ "assigned_to": {
985
+ "name": "assigned_to",
986
+ "type": "text",
987
+ "primaryKey": false,
988
+ "notNull": false,
989
+ "autoincrement": false
990
+ },
991
+ "created_at": {
992
+ "name": "created_at",
993
+ "type": "integer",
994
+ "primaryKey": false,
995
+ "notNull": true,
996
+ "autoincrement": false,
997
+ "default": "(unixepoch() * 1000)"
998
+ },
999
+ "updated_at": {
1000
+ "name": "updated_at",
1001
+ "type": "integer",
1002
+ "primaryKey": false,
1003
+ "notNull": true,
1004
+ "autoincrement": false,
1005
+ "default": "(unixepoch() * 1000)"
1006
+ }
1007
+ },
1008
+ "indexes": {
1009
+ "tickets_status_idx": {
1010
+ "name": "tickets_status_idx",
1011
+ "columns": ["status"],
1012
+ "isUnique": false
1013
+ },
1014
+ "tickets_created_at_idx": {
1015
+ "name": "tickets_created_at_idx",
1016
+ "columns": ["created_at"],
1017
+ "isUnique": false
1018
+ }
1019
+ },
1020
+ "foreignKeys": {},
1021
+ "compositePrimaryKeys": {},
1022
+ "uniqueConstraints": {},
1023
+ "checkConstraints": {}
1024
+ },
1025
+ "disputes": {
1026
+ "name": "disputes",
1027
+ "columns": {
1028
+ "id": {
1029
+ "name": "id",
1030
+ "type": "integer",
1031
+ "primaryKey": true,
1032
+ "notNull": true,
1033
+ "autoincrement": true
1034
+ },
1035
+ "dispute_no": {
1036
+ "name": "dispute_no",
1037
+ "type": "text",
1038
+ "primaryKey": false,
1039
+ "notNull": true,
1040
+ "autoincrement": false
1041
+ },
1042
+ "order_id": {
1043
+ "name": "order_id",
1044
+ "type": "text",
1045
+ "primaryKey": false,
1046
+ "notNull": true,
1047
+ "autoincrement": false
1048
+ },
1049
+ "order_no": {
1050
+ "name": "order_no",
1051
+ "type": "text",
1052
+ "primaryKey": false,
1053
+ "notNull": true,
1054
+ "autoincrement": false
1055
+ },
1056
+ "customer_name": {
1057
+ "name": "customer_name",
1058
+ "type": "text",
1059
+ "primaryKey": false,
1060
+ "notNull": true,
1061
+ "autoincrement": false
1062
+ },
1063
+ "customer_email": {
1064
+ "name": "customer_email",
1065
+ "type": "text",
1066
+ "primaryKey": false,
1067
+ "notNull": true,
1068
+ "autoincrement": false
1069
+ },
1070
+ "type": {
1071
+ "name": "type",
1072
+ "type": "text",
1073
+ "primaryKey": false,
1074
+ "notNull": true,
1075
+ "autoincrement": false
1076
+ },
1077
+ "status": {
1078
+ "name": "status",
1079
+ "type": "text",
1080
+ "primaryKey": false,
1081
+ "notNull": true,
1082
+ "autoincrement": false,
1083
+ "default": "'pending'"
1084
+ },
1085
+ "description": {
1086
+ "name": "description",
1087
+ "type": "text",
1088
+ "primaryKey": false,
1089
+ "notNull": true,
1090
+ "autoincrement": false
1091
+ },
1092
+ "resolution": {
1093
+ "name": "resolution",
1094
+ "type": "text",
1095
+ "primaryKey": false,
1096
+ "notNull": false,
1097
+ "autoincrement": false
1098
+ },
1099
+ "amount": {
1100
+ "name": "amount",
1101
+ "type": "integer",
1102
+ "primaryKey": false,
1103
+ "notNull": true,
1104
+ "autoincrement": false
1105
+ },
1106
+ "resolved_at": {
1107
+ "name": "resolved_at",
1108
+ "type": "integer",
1109
+ "primaryKey": false,
1110
+ "notNull": false,
1111
+ "autoincrement": false
1112
+ },
1113
+ "resolved_by": {
1114
+ "name": "resolved_by",
1115
+ "type": "text",
1116
+ "primaryKey": false,
1117
+ "notNull": false,
1118
+ "autoincrement": false
1119
+ },
1120
+ "created_at": {
1121
+ "name": "created_at",
1122
+ "type": "integer",
1123
+ "primaryKey": false,
1124
+ "notNull": true,
1125
+ "autoincrement": false,
1126
+ "default": "(unixepoch() * 1000)"
1127
+ },
1128
+ "updated_at": {
1129
+ "name": "updated_at",
1130
+ "type": "integer",
1131
+ "primaryKey": false,
1132
+ "notNull": true,
1133
+ "autoincrement": false,
1134
+ "default": "(unixepoch() * 1000)"
1135
+ }
1136
+ },
1137
+ "indexes": {
1138
+ "disputes_status_idx": {
1139
+ "name": "disputes_status_idx",
1140
+ "columns": ["status"],
1141
+ "isUnique": false
1142
+ },
1143
+ "disputes_order_id_idx": {
1144
+ "name": "disputes_order_id_idx",
1145
+ "columns": ["order_id"],
1146
+ "isUnique": false
1147
+ },
1148
+ "disputes_created_at_idx": {
1149
+ "name": "disputes_created_at_idx",
1150
+ "columns": ["created_at"],
1151
+ "isUnique": false
1152
+ }
1153
+ },
1154
+ "foreignKeys": {},
1155
+ "compositePrimaryKeys": {},
1156
+ "uniqueConstraints": {},
1157
+ "checkConstraints": {}
1158
+ },
1159
+ "contents": {
1160
+ "name": "contents",
1161
+ "columns": {
1162
+ "id": {
1163
+ "name": "id",
1164
+ "type": "integer",
1165
+ "primaryKey": true,
1166
+ "notNull": true,
1167
+ "autoincrement": true
1168
+ },
1169
+ "title": {
1170
+ "name": "title",
1171
+ "type": "text",
1172
+ "primaryKey": false,
1173
+ "notNull": true,
1174
+ "autoincrement": false
1175
+ },
1176
+ "body": {
1177
+ "name": "body",
1178
+ "type": "text",
1179
+ "primaryKey": false,
1180
+ "notNull": true,
1181
+ "autoincrement": false
1182
+ },
1183
+ "excerpt": {
1184
+ "name": "excerpt",
1185
+ "type": "text",
1186
+ "primaryKey": false,
1187
+ "notNull": false,
1188
+ "autoincrement": false
1189
+ },
1190
+ "category": {
1191
+ "name": "category",
1192
+ "type": "text",
1193
+ "primaryKey": false,
1194
+ "notNull": true,
1195
+ "autoincrement": false
1196
+ },
1197
+ "tags": {
1198
+ "name": "tags",
1199
+ "type": "text",
1200
+ "primaryKey": false,
1201
+ "notNull": false,
1202
+ "autoincrement": false
1203
+ },
1204
+ "status": {
1205
+ "name": "status",
1206
+ "type": "text",
1207
+ "primaryKey": false,
1208
+ "notNull": true,
1209
+ "autoincrement": false,
1210
+ "default": "'draft'"
1211
+ },
1212
+ "author": {
1213
+ "name": "author",
1214
+ "type": "text",
1215
+ "primaryKey": false,
1216
+ "notNull": true,
1217
+ "autoincrement": false
1218
+ },
1219
+ "view_count": {
1220
+ "name": "view_count",
1221
+ "type": "integer",
1222
+ "primaryKey": false,
1223
+ "notNull": true,
1224
+ "autoincrement": false,
1225
+ "default": 0
1226
+ },
1227
+ "like_count": {
1228
+ "name": "like_count",
1229
+ "type": "integer",
1230
+ "primaryKey": false,
1231
+ "notNull": true,
1232
+ "autoincrement": false,
1233
+ "default": 0
1234
+ },
1235
+ "published_at": {
1236
+ "name": "published_at",
1237
+ "type": "integer",
1238
+ "primaryKey": false,
1239
+ "notNull": false,
1240
+ "autoincrement": false
1241
+ },
1242
+ "created_at": {
1243
+ "name": "created_at",
1244
+ "type": "integer",
1245
+ "primaryKey": false,
1246
+ "notNull": true,
1247
+ "autoincrement": false,
1248
+ "default": "(unixepoch() * 1000)"
1249
+ },
1250
+ "updated_at": {
1251
+ "name": "updated_at",
1252
+ "type": "integer",
1253
+ "primaryKey": false,
1254
+ "notNull": true,
1255
+ "autoincrement": false,
1256
+ "default": "(unixepoch() * 1000)"
1257
+ }
1258
+ },
1259
+ "indexes": {
1260
+ "contents_status_idx": {
1261
+ "name": "contents_status_idx",
1262
+ "columns": ["status"],
1263
+ "isUnique": false
1264
+ },
1265
+ "contents_category_idx": {
1266
+ "name": "contents_category_idx",
1267
+ "columns": ["category"],
1268
+ "isUnique": false
1269
+ },
1270
+ "contents_created_at_idx": {
1271
+ "name": "contents_created_at_idx",
1272
+ "columns": ["created_at"],
1273
+ "isUnique": false
1274
+ }
1275
+ },
1276
+ "foreignKeys": {},
1277
+ "compositePrimaryKeys": {},
1278
+ "uniqueConstraints": {},
1279
+ "checkConstraints": {}
1280
+ },
1281
+ "developers": {
1282
+ "name": "developers",
1283
+ "columns": {
1284
+ "id": {
1285
+ "name": "id",
1286
+ "type": "text",
1287
+ "primaryKey": true,
1288
+ "notNull": true,
1289
+ "autoincrement": false
1290
+ },
1291
+ "username": {
1292
+ "name": "username",
1293
+ "type": "text",
1294
+ "primaryKey": false,
1295
+ "notNull": true,
1296
+ "autoincrement": false
1297
+ },
1298
+ "email": {
1299
+ "name": "email",
1300
+ "type": "text",
1301
+ "primaryKey": false,
1302
+ "notNull": true,
1303
+ "autoincrement": false
1304
+ },
1305
+ "password_hash": {
1306
+ "name": "password_hash",
1307
+ "type": "text",
1308
+ "primaryKey": false,
1309
+ "notNull": true,
1310
+ "autoincrement": false
1311
+ },
1312
+ "role": {
1313
+ "name": "role",
1314
+ "type": "text",
1315
+ "primaryKey": false,
1316
+ "notNull": true,
1317
+ "autoincrement": false,
1318
+ "default": "'developer'"
1319
+ },
1320
+ "api_key": {
1321
+ "name": "api_key",
1322
+ "type": "text",
1323
+ "primaryKey": false,
1324
+ "notNull": true,
1325
+ "autoincrement": false
1326
+ },
1327
+ "created_at": {
1328
+ "name": "created_at",
1329
+ "type": "integer",
1330
+ "primaryKey": false,
1331
+ "notNull": true,
1332
+ "autoincrement": false,
1333
+ "default": "(unixepoch() * 1000)"
1334
+ },
1335
+ "updated_at": {
1336
+ "name": "updated_at",
1337
+ "type": "integer",
1338
+ "primaryKey": false,
1339
+ "notNull": true,
1340
+ "autoincrement": false,
1341
+ "default": "(unixepoch() * 1000)"
1342
+ }
1343
+ },
1344
+ "indexes": {
1345
+ "developers_username_unique": {
1346
+ "name": "developers_username_unique",
1347
+ "columns": ["username"],
1348
+ "isUnique": true
1349
+ },
1350
+ "developers_email_unique": {
1351
+ "name": "developers_email_unique",
1352
+ "columns": ["email"],
1353
+ "isUnique": true
1354
+ },
1355
+ "developers_api_key_unique": {
1356
+ "name": "developers_api_key_unique",
1357
+ "columns": ["api_key"],
1358
+ "isUnique": true
1359
+ }
1360
+ },
1361
+ "foreignKeys": {},
1362
+ "compositePrimaryKeys": {},
1363
+ "uniqueConstraints": {},
1364
+ "checkConstraints": {}
1365
+ },
1366
+ "plugin_categories": {
1367
+ "name": "plugin_categories",
1368
+ "columns": {
1369
+ "id": {
1370
+ "name": "id",
1371
+ "type": "text",
1372
+ "primaryKey": true,
1373
+ "notNull": true,
1374
+ "autoincrement": false
1375
+ },
1376
+ "name": {
1377
+ "name": "name",
1378
+ "type": "text",
1379
+ "primaryKey": false,
1380
+ "notNull": true,
1381
+ "autoincrement": false
1382
+ },
1383
+ "slug": {
1384
+ "name": "slug",
1385
+ "type": "text",
1386
+ "primaryKey": false,
1387
+ "notNull": true,
1388
+ "autoincrement": false
1389
+ },
1390
+ "description": {
1391
+ "name": "description",
1392
+ "type": "text",
1393
+ "primaryKey": false,
1394
+ "notNull": false,
1395
+ "autoincrement": false
1396
+ },
1397
+ "icon": {
1398
+ "name": "icon",
1399
+ "type": "text",
1400
+ "primaryKey": false,
1401
+ "notNull": false,
1402
+ "autoincrement": false
1403
+ },
1404
+ "sort_order": {
1405
+ "name": "sort_order",
1406
+ "type": "integer",
1407
+ "primaryKey": false,
1408
+ "notNull": true,
1409
+ "autoincrement": false,
1410
+ "default": 0
1411
+ }
1412
+ },
1413
+ "indexes": {
1414
+ "plugin_categories_name_unique": {
1415
+ "name": "plugin_categories_name_unique",
1416
+ "columns": ["name"],
1417
+ "isUnique": true
1418
+ },
1419
+ "plugin_categories_slug_unique": {
1420
+ "name": "plugin_categories_slug_unique",
1421
+ "columns": ["slug"],
1422
+ "isUnique": true
1423
+ },
1424
+ "plugin_categories_slug_idx": {
1425
+ "name": "plugin_categories_slug_idx",
1426
+ "columns": ["slug"],
1427
+ "isUnique": false
1428
+ }
1429
+ },
1430
+ "foreignKeys": {},
1431
+ "compositePrimaryKeys": {},
1432
+ "uniqueConstraints": {},
1433
+ "checkConstraints": {}
1434
+ },
1435
+ "plugin_category_mappings": {
1436
+ "name": "plugin_category_mappings",
1437
+ "columns": {
1438
+ "plugin_id": {
1439
+ "name": "plugin_id",
1440
+ "type": "text",
1441
+ "primaryKey": false,
1442
+ "notNull": true,
1443
+ "autoincrement": false
1444
+ },
1445
+ "category_id": {
1446
+ "name": "category_id",
1447
+ "type": "text",
1448
+ "primaryKey": false,
1449
+ "notNull": true,
1450
+ "autoincrement": false
1451
+ }
1452
+ },
1453
+ "indexes": {
1454
+ "plugin_category_mapping_unique": {
1455
+ "name": "plugin_category_mapping_unique",
1456
+ "columns": ["plugin_id", "category_id"],
1457
+ "isUnique": true
1458
+ },
1459
+ "plugin_category_mappings_category_id_idx": {
1460
+ "name": "plugin_category_mappings_category_id_idx",
1461
+ "columns": ["category_id"],
1462
+ "isUnique": false
1463
+ },
1464
+ "plugin_category_mappings_plugin_id_idx": {
1465
+ "name": "plugin_category_mappings_plugin_id_idx",
1466
+ "columns": ["plugin_id"],
1467
+ "isUnique": false
1468
+ }
1469
+ },
1470
+ "foreignKeys": {
1471
+ "plugin_category_mappings_plugin_id_plugins_id_fk": {
1472
+ "name": "plugin_category_mappings_plugin_id_plugins_id_fk",
1473
+ "tableFrom": "plugin_category_mappings",
1474
+ "tableTo": "plugins",
1475
+ "columnsFrom": ["plugin_id"],
1476
+ "columnsTo": ["id"],
1477
+ "onDelete": "cascade",
1478
+ "onUpdate": "no action"
1479
+ },
1480
+ "plugin_category_mappings_category_id_plugin_categories_id_fk": {
1481
+ "name": "plugin_category_mappings_category_id_plugin_categories_id_fk",
1482
+ "tableFrom": "plugin_category_mappings",
1483
+ "tableTo": "plugin_categories",
1484
+ "columnsFrom": ["category_id"],
1485
+ "columnsTo": ["id"],
1486
+ "onDelete": "cascade",
1487
+ "onUpdate": "no action"
1488
+ }
1489
+ },
1490
+ "compositePrimaryKeys": {},
1491
+ "uniqueConstraints": {},
1492
+ "checkConstraints": {}
1493
+ },
1494
+ "plugin_reviews": {
1495
+ "name": "plugin_reviews",
1496
+ "columns": {
1497
+ "id": {
1498
+ "name": "id",
1499
+ "type": "text",
1500
+ "primaryKey": true,
1501
+ "notNull": true,
1502
+ "autoincrement": false
1503
+ },
1504
+ "plugin_id": {
1505
+ "name": "plugin_id",
1506
+ "type": "text",
1507
+ "primaryKey": false,
1508
+ "notNull": true,
1509
+ "autoincrement": false
1510
+ },
1511
+ "user_id": {
1512
+ "name": "user_id",
1513
+ "type": "text",
1514
+ "primaryKey": false,
1515
+ "notNull": true,
1516
+ "autoincrement": false
1517
+ },
1518
+ "user_name": {
1519
+ "name": "user_name",
1520
+ "type": "text",
1521
+ "primaryKey": false,
1522
+ "notNull": true,
1523
+ "autoincrement": false
1524
+ },
1525
+ "rating": {
1526
+ "name": "rating",
1527
+ "type": "integer",
1528
+ "primaryKey": false,
1529
+ "notNull": true,
1530
+ "autoincrement": false
1531
+ },
1532
+ "title": {
1533
+ "name": "title",
1534
+ "type": "text",
1535
+ "primaryKey": false,
1536
+ "notNull": false,
1537
+ "autoincrement": false
1538
+ },
1539
+ "content": {
1540
+ "name": "content",
1541
+ "type": "text",
1542
+ "primaryKey": false,
1543
+ "notNull": false,
1544
+ "autoincrement": false
1545
+ },
1546
+ "created_at": {
1547
+ "name": "created_at",
1548
+ "type": "integer",
1549
+ "primaryKey": false,
1550
+ "notNull": true,
1551
+ "autoincrement": false,
1552
+ "default": "(unixepoch() * 1000)"
1553
+ }
1554
+ },
1555
+ "indexes": {
1556
+ "plugin_review_user_unique": {
1557
+ "name": "plugin_review_user_unique",
1558
+ "columns": ["plugin_id", "user_id"],
1559
+ "isUnique": true
1560
+ }
1561
+ },
1562
+ "foreignKeys": {
1563
+ "plugin_reviews_plugin_id_plugins_id_fk": {
1564
+ "name": "plugin_reviews_plugin_id_plugins_id_fk",
1565
+ "tableFrom": "plugin_reviews",
1566
+ "tableTo": "plugins",
1567
+ "columnsFrom": ["plugin_id"],
1568
+ "columnsTo": ["id"],
1569
+ "onDelete": "cascade",
1570
+ "onUpdate": "no action"
1571
+ }
1572
+ },
1573
+ "compositePrimaryKeys": {},
1574
+ "uniqueConstraints": {},
1575
+ "checkConstraints": {}
1576
+ },
1577
+ "plugin_versions": {
1578
+ "name": "plugin_versions",
1579
+ "columns": {
1580
+ "id": {
1581
+ "name": "id",
1582
+ "type": "text",
1583
+ "primaryKey": true,
1584
+ "notNull": true,
1585
+ "autoincrement": false
1586
+ },
1587
+ "plugin_id": {
1588
+ "name": "plugin_id",
1589
+ "type": "text",
1590
+ "primaryKey": false,
1591
+ "notNull": true,
1592
+ "autoincrement": false
1593
+ },
1594
+ "version": {
1595
+ "name": "version",
1596
+ "type": "text",
1597
+ "primaryKey": false,
1598
+ "notNull": true,
1599
+ "autoincrement": false
1600
+ },
1601
+ "changelog": {
1602
+ "name": "changelog",
1603
+ "type": "text",
1604
+ "primaryKey": false,
1605
+ "notNull": false,
1606
+ "autoincrement": false
1607
+ },
1608
+ "package_url": {
1609
+ "name": "package_url",
1610
+ "type": "text",
1611
+ "primaryKey": false,
1612
+ "notNull": false,
1613
+ "autoincrement": false
1614
+ },
1615
+ "file_size": {
1616
+ "name": "file_size",
1617
+ "type": "integer",
1618
+ "primaryKey": false,
1619
+ "notNull": false,
1620
+ "autoincrement": false
1621
+ },
1622
+ "checksum": {
1623
+ "name": "checksum",
1624
+ "type": "text",
1625
+ "primaryKey": false,
1626
+ "notNull": false,
1627
+ "autoincrement": false
1628
+ },
1629
+ "status": {
1630
+ "name": "status",
1631
+ "type": "text",
1632
+ "primaryKey": false,
1633
+ "notNull": true,
1634
+ "autoincrement": false,
1635
+ "default": "'pending'"
1636
+ },
1637
+ "published_at": {
1638
+ "name": "published_at",
1639
+ "type": "integer",
1640
+ "primaryKey": false,
1641
+ "notNull": true,
1642
+ "autoincrement": false,
1643
+ "default": "(unixepoch() * 1000)"
1644
+ }
1645
+ },
1646
+ "indexes": {
1647
+ "plugin_version_unique": {
1648
+ "name": "plugin_version_unique",
1649
+ "columns": ["plugin_id", "version"],
1650
+ "isUnique": true
1651
+ },
1652
+ "plugin_versions_plugin_id_idx": {
1653
+ "name": "plugin_versions_plugin_id_idx",
1654
+ "columns": ["plugin_id"],
1655
+ "isUnique": false
1656
+ }
1657
+ },
1658
+ "foreignKeys": {
1659
+ "plugin_versions_plugin_id_plugins_id_fk": {
1660
+ "name": "plugin_versions_plugin_id_plugins_id_fk",
1661
+ "tableFrom": "plugin_versions",
1662
+ "tableTo": "plugins",
1663
+ "columnsFrom": ["plugin_id"],
1664
+ "columnsTo": ["id"],
1665
+ "onDelete": "cascade",
1666
+ "onUpdate": "no action"
1667
+ }
1668
+ },
1669
+ "compositePrimaryKeys": {},
1670
+ "uniqueConstraints": {},
1671
+ "checkConstraints": {}
1672
+ },
1673
+ "plugins": {
1674
+ "name": "plugins",
1675
+ "columns": {
1676
+ "id": {
1677
+ "name": "id",
1678
+ "type": "text",
1679
+ "primaryKey": true,
1680
+ "notNull": true,
1681
+ "autoincrement": false
1682
+ },
1683
+ "name": {
1684
+ "name": "name",
1685
+ "type": "text",
1686
+ "primaryKey": false,
1687
+ "notNull": true,
1688
+ "autoincrement": false
1689
+ },
1690
+ "slug": {
1691
+ "name": "slug",
1692
+ "type": "text",
1693
+ "primaryKey": false,
1694
+ "notNull": true,
1695
+ "autoincrement": false
1696
+ },
1697
+ "description": {
1698
+ "name": "description",
1699
+ "type": "text",
1700
+ "primaryKey": false,
1701
+ "notNull": true,
1702
+ "autoincrement": false,
1703
+ "default": "''"
1704
+ },
1705
+ "readme": {
1706
+ "name": "readme",
1707
+ "type": "text",
1708
+ "primaryKey": false,
1709
+ "notNull": false,
1710
+ "autoincrement": false
1711
+ },
1712
+ "author_id": {
1713
+ "name": "author_id",
1714
+ "type": "text",
1715
+ "primaryKey": false,
1716
+ "notNull": true,
1717
+ "autoincrement": false
1718
+ },
1719
+ "author_name": {
1720
+ "name": "author_name",
1721
+ "type": "text",
1722
+ "primaryKey": false,
1723
+ "notNull": true,
1724
+ "autoincrement": false
1725
+ },
1726
+ "repository_url": {
1727
+ "name": "repository_url",
1728
+ "type": "text",
1729
+ "primaryKey": false,
1730
+ "notNull": false,
1731
+ "autoincrement": false
1732
+ },
1733
+ "homepage_url": {
1734
+ "name": "homepage_url",
1735
+ "type": "text",
1736
+ "primaryKey": false,
1737
+ "notNull": false,
1738
+ "autoincrement": false
1739
+ },
1740
+ "npm_package": {
1741
+ "name": "npm_package",
1742
+ "type": "text",
1743
+ "primaryKey": false,
1744
+ "notNull": false,
1745
+ "autoincrement": false
1746
+ },
1747
+ "license": {
1748
+ "name": "license",
1749
+ "type": "text",
1750
+ "primaryKey": false,
1751
+ "notNull": false,
1752
+ "autoincrement": false
1753
+ },
1754
+ "version": {
1755
+ "name": "version",
1756
+ "type": "text",
1757
+ "primaryKey": false,
1758
+ "notNull": true,
1759
+ "autoincrement": false,
1760
+ "default": "'0.0.1'"
1761
+ },
1762
+ "status": {
1763
+ "name": "status",
1764
+ "type": "text",
1765
+ "primaryKey": false,
1766
+ "notNull": true,
1767
+ "autoincrement": false,
1768
+ "default": "'pending'"
1769
+ },
1770
+ "download_count": {
1771
+ "name": "download_count",
1772
+ "type": "integer",
1773
+ "primaryKey": false,
1774
+ "notNull": true,
1775
+ "autoincrement": false,
1776
+ "default": 0
1777
+ },
1778
+ "view_count": {
1779
+ "name": "view_count",
1780
+ "type": "integer",
1781
+ "primaryKey": false,
1782
+ "notNull": true,
1783
+ "autoincrement": false,
1784
+ "default": 0
1785
+ },
1786
+ "featured": {
1787
+ "name": "featured",
1788
+ "type": "integer",
1789
+ "primaryKey": false,
1790
+ "notNull": true,
1791
+ "autoincrement": false,
1792
+ "default": false
1793
+ },
1794
+ "screenshot_url": {
1795
+ "name": "screenshot_url",
1796
+ "type": "text",
1797
+ "primaryKey": false,
1798
+ "notNull": false,
1799
+ "autoincrement": false
1800
+ },
1801
+ "site_urls": {
1802
+ "name": "site_urls",
1803
+ "type": "text",
1804
+ "primaryKey": false,
1805
+ "notNull": false,
1806
+ "autoincrement": false
1807
+ },
1808
+ "tags": {
1809
+ "name": "tags",
1810
+ "type": "text",
1811
+ "primaryKey": false,
1812
+ "notNull": false,
1813
+ "autoincrement": false
1814
+ },
1815
+ "commands": {
1816
+ "name": "commands",
1817
+ "type": "text",
1818
+ "primaryKey": false,
1819
+ "notNull": false,
1820
+ "autoincrement": false
1821
+ },
1822
+ "reject_reason": {
1823
+ "name": "reject_reason",
1824
+ "type": "text",
1825
+ "primaryKey": false,
1826
+ "notNull": false,
1827
+ "autoincrement": false
1828
+ },
1829
+ "created_at": {
1830
+ "name": "created_at",
1831
+ "type": "integer",
1832
+ "primaryKey": false,
1833
+ "notNull": true,
1834
+ "autoincrement": false,
1835
+ "default": "(unixepoch() * 1000)"
1836
+ },
1837
+ "updated_at": {
1838
+ "name": "updated_at",
1839
+ "type": "integer",
1840
+ "primaryKey": false,
1841
+ "notNull": true,
1842
+ "autoincrement": false,
1843
+ "default": "(unixepoch() * 1000)"
1844
+ }
1845
+ },
1846
+ "indexes": {
1847
+ "plugins_slug_unique": {
1848
+ "name": "plugins_slug_unique",
1849
+ "columns": ["slug"],
1850
+ "isUnique": true
1851
+ },
1852
+ "plugins_status_idx": {
1853
+ "name": "plugins_status_idx",
1854
+ "columns": ["status"],
1855
+ "isUnique": false
1856
+ },
1857
+ "plugins_slug_idx": {
1858
+ "name": "plugins_slug_idx",
1859
+ "columns": ["slug"],
1860
+ "isUnique": false
1861
+ },
1862
+ "plugins_author_id_idx": {
1863
+ "name": "plugins_author_id_idx",
1864
+ "columns": ["author_id"],
1865
+ "isUnique": false
1866
+ },
1867
+ "plugins_created_at_idx": {
1868
+ "name": "plugins_created_at_idx",
1869
+ "columns": ["created_at"],
1870
+ "isUnique": false
1871
+ }
1872
+ },
1873
+ "foreignKeys": {},
1874
+ "compositePrimaryKeys": {},
1875
+ "uniqueConstraints": {},
1876
+ "checkConstraints": {}
1877
+ },
1878
+ "tenants": {
1879
+ "name": "tenants",
1880
+ "columns": {
1881
+ "id": {
1882
+ "name": "id",
1883
+ "type": "integer",
1884
+ "primaryKey": true,
1885
+ "notNull": true,
1886
+ "autoincrement": true
1887
+ },
1888
+ "name": {
1889
+ "name": "name",
1890
+ "type": "text",
1891
+ "primaryKey": false,
1892
+ "notNull": true,
1893
+ "autoincrement": false
1894
+ },
1895
+ "slug": {
1896
+ "name": "slug",
1897
+ "type": "text",
1898
+ "primaryKey": false,
1899
+ "notNull": true,
1900
+ "autoincrement": false
1901
+ },
1902
+ "status": {
1903
+ "name": "status",
1904
+ "type": "text",
1905
+ "primaryKey": false,
1906
+ "notNull": true,
1907
+ "autoincrement": false,
1908
+ "default": "'trial'"
1909
+ },
1910
+ "plan": {
1911
+ "name": "plan",
1912
+ "type": "text",
1913
+ "primaryKey": false,
1914
+ "notNull": true,
1915
+ "autoincrement": false,
1916
+ "default": "'free'"
1917
+ },
1918
+ "max_users": {
1919
+ "name": "max_users",
1920
+ "type": "integer",
1921
+ "primaryKey": false,
1922
+ "notNull": true,
1923
+ "autoincrement": false,
1924
+ "default": 5
1925
+ },
1926
+ "settings": {
1927
+ "name": "settings",
1928
+ "type": "text",
1929
+ "primaryKey": false,
1930
+ "notNull": false,
1931
+ "autoincrement": false
1932
+ },
1933
+ "created_at": {
1934
+ "name": "created_at",
1935
+ "type": "text",
1936
+ "primaryKey": false,
1937
+ "notNull": true,
1938
+ "autoincrement": false
1939
+ },
1940
+ "updated_at": {
1941
+ "name": "updated_at",
1942
+ "type": "text",
1943
+ "primaryKey": false,
1944
+ "notNull": true,
1945
+ "autoincrement": false
1946
+ }
1947
+ },
1948
+ "indexes": {
1949
+ "tenants_slug_unique": {
1950
+ "name": "tenants_slug_unique",
1951
+ "columns": ["slug"],
1952
+ "isUnique": true
1953
+ }
1954
+ },
1955
+ "foreignKeys": {},
1956
+ "compositePrimaryKeys": {},
1957
+ "uniqueConstraints": {},
1958
+ "checkConstraints": {}
1959
+ },
1960
+ "tenant_roles": {
1961
+ "name": "tenant_roles",
1962
+ "columns": {
1963
+ "id": {
1964
+ "name": "id",
1965
+ "type": "text",
1966
+ "primaryKey": true,
1967
+ "notNull": true,
1968
+ "autoincrement": false
1969
+ },
1970
+ "tenant_id": {
1971
+ "name": "tenant_id",
1972
+ "type": "integer",
1973
+ "primaryKey": false,
1974
+ "notNull": true,
1975
+ "autoincrement": false
1976
+ },
1977
+ "code": {
1978
+ "name": "code",
1979
+ "type": "text",
1980
+ "primaryKey": false,
1981
+ "notNull": true,
1982
+ "autoincrement": false
1983
+ },
1984
+ "name": {
1985
+ "name": "name",
1986
+ "type": "text",
1987
+ "primaryKey": false,
1988
+ "notNull": true,
1989
+ "autoincrement": false
1990
+ },
1991
+ "label": {
1992
+ "name": "label",
1993
+ "type": "text",
1994
+ "primaryKey": false,
1995
+ "notNull": true,
1996
+ "autoincrement": false
1997
+ },
1998
+ "description": {
1999
+ "name": "description",
2000
+ "type": "text",
2001
+ "primaryKey": false,
2002
+ "notNull": false,
2003
+ "autoincrement": false
2004
+ },
2005
+ "permissions": {
2006
+ "name": "permissions",
2007
+ "type": "text",
2008
+ "primaryKey": false,
2009
+ "notNull": true,
2010
+ "autoincrement": false
2011
+ },
2012
+ "is_system": {
2013
+ "name": "is_system",
2014
+ "type": "integer",
2015
+ "primaryKey": false,
2016
+ "notNull": true,
2017
+ "autoincrement": false,
2018
+ "default": false
2019
+ },
2020
+ "is_active": {
2021
+ "name": "is_active",
2022
+ "type": "integer",
2023
+ "primaryKey": false,
2024
+ "notNull": true,
2025
+ "autoincrement": false,
2026
+ "default": true
2027
+ },
2028
+ "sort_order": {
2029
+ "name": "sort_order",
2030
+ "type": "integer",
2031
+ "primaryKey": false,
2032
+ "notNull": true,
2033
+ "autoincrement": false,
2034
+ "default": 0
2035
+ },
2036
+ "created_at": {
2037
+ "name": "created_at",
2038
+ "type": "text",
2039
+ "primaryKey": false,
2040
+ "notNull": true,
2041
+ "autoincrement": false
2042
+ },
2043
+ "updated_at": {
2044
+ "name": "updated_at",
2045
+ "type": "text",
2046
+ "primaryKey": false,
2047
+ "notNull": true,
2048
+ "autoincrement": false
2049
+ }
2050
+ },
2051
+ "indexes": {
2052
+ "tenant_roles_tenant_id_code_unique": {
2053
+ "name": "tenant_roles_tenant_id_code_unique",
2054
+ "columns": ["tenant_id", "code"],
2055
+ "isUnique": true
2056
+ }
2057
+ },
2058
+ "foreignKeys": {
2059
+ "tenant_roles_tenant_id_tenants_id_fk": {
2060
+ "name": "tenant_roles_tenant_id_tenants_id_fk",
2061
+ "tableFrom": "tenant_roles",
2062
+ "tableTo": "tenants",
2063
+ "columnsFrom": ["tenant_id"],
2064
+ "columnsTo": ["id"],
2065
+ "onDelete": "cascade",
2066
+ "onUpdate": "no action"
2067
+ }
2068
+ },
2069
+ "compositePrimaryKeys": {},
2070
+ "uniqueConstraints": {},
2071
+ "checkConstraints": {}
2072
+ },
2073
+ "tenant_members": {
2074
+ "name": "tenant_members",
2075
+ "columns": {
2076
+ "id": {
2077
+ "name": "id",
2078
+ "type": "text",
2079
+ "primaryKey": true,
2080
+ "notNull": true,
2081
+ "autoincrement": false
2082
+ },
2083
+ "tenant_id": {
2084
+ "name": "tenant_id",
2085
+ "type": "integer",
2086
+ "primaryKey": false,
2087
+ "notNull": true,
2088
+ "autoincrement": false
2089
+ },
2090
+ "user_id": {
2091
+ "name": "user_id",
2092
+ "type": "text",
2093
+ "primaryKey": false,
2094
+ "notNull": true,
2095
+ "autoincrement": false
2096
+ },
2097
+ "role_id": {
2098
+ "name": "role_id",
2099
+ "type": "text",
2100
+ "primaryKey": false,
2101
+ "notNull": true,
2102
+ "autoincrement": false
2103
+ },
2104
+ "status": {
2105
+ "name": "status",
2106
+ "type": "text",
2107
+ "primaryKey": false,
2108
+ "notNull": true,
2109
+ "autoincrement": false,
2110
+ "default": "'active'"
2111
+ },
2112
+ "invited_by": {
2113
+ "name": "invited_by",
2114
+ "type": "text",
2115
+ "primaryKey": false,
2116
+ "notNull": false,
2117
+ "autoincrement": false
2118
+ },
2119
+ "invited_at": {
2120
+ "name": "invited_at",
2121
+ "type": "text",
2122
+ "primaryKey": false,
2123
+ "notNull": false,
2124
+ "autoincrement": false
2125
+ },
2126
+ "joined_at": {
2127
+ "name": "joined_at",
2128
+ "type": "text",
2129
+ "primaryKey": false,
2130
+ "notNull": true,
2131
+ "autoincrement": false
2132
+ },
2133
+ "last_active_at": {
2134
+ "name": "last_active_at",
2135
+ "type": "text",
2136
+ "primaryKey": false,
2137
+ "notNull": false,
2138
+ "autoincrement": false
2139
+ }
2140
+ },
2141
+ "indexes": {
2142
+ "tenant_members_user_id_tenant_id_unique": {
2143
+ "name": "tenant_members_user_id_tenant_id_unique",
2144
+ "columns": ["user_id", "tenant_id"],
2145
+ "isUnique": true
2146
+ }
2147
+ },
2148
+ "foreignKeys": {
2149
+ "tenant_members_tenant_id_tenants_id_fk": {
2150
+ "name": "tenant_members_tenant_id_tenants_id_fk",
2151
+ "tableFrom": "tenant_members",
2152
+ "tableTo": "tenants",
2153
+ "columnsFrom": ["tenant_id"],
2154
+ "columnsTo": ["id"],
2155
+ "onDelete": "cascade",
2156
+ "onUpdate": "no action"
2157
+ },
2158
+ "tenant_members_role_id_tenant_roles_id_fk": {
2159
+ "name": "tenant_members_role_id_tenant_roles_id_fk",
2160
+ "tableFrom": "tenant_members",
2161
+ "tableTo": "tenant_roles",
2162
+ "columnsFrom": ["role_id"],
2163
+ "columnsTo": ["id"],
2164
+ "onDelete": "cascade",
2165
+ "onUpdate": "no action"
2166
+ }
2167
+ },
2168
+ "compositePrimaryKeys": {},
2169
+ "uniqueConstraints": {},
2170
+ "checkConstraints": {}
2171
+ },
2172
+ "tenant_invitations": {
2173
+ "name": "tenant_invitations",
2174
+ "columns": {
2175
+ "id": {
2176
+ "name": "id",
2177
+ "type": "text",
2178
+ "primaryKey": true,
2179
+ "notNull": true,
2180
+ "autoincrement": false
2181
+ },
2182
+ "tenant_id": {
2183
+ "name": "tenant_id",
2184
+ "type": "integer",
2185
+ "primaryKey": false,
2186
+ "notNull": true,
2187
+ "autoincrement": false
2188
+ },
2189
+ "email": {
2190
+ "name": "email",
2191
+ "type": "text",
2192
+ "primaryKey": false,
2193
+ "notNull": true,
2194
+ "autoincrement": false
2195
+ },
2196
+ "role_id": {
2197
+ "name": "role_id",
2198
+ "type": "text",
2199
+ "primaryKey": false,
2200
+ "notNull": true,
2201
+ "autoincrement": false
2202
+ },
2203
+ "inviter_id": {
2204
+ "name": "inviter_id",
2205
+ "type": "text",
2206
+ "primaryKey": false,
2207
+ "notNull": true,
2208
+ "autoincrement": false
2209
+ },
2210
+ "token": {
2211
+ "name": "token",
2212
+ "type": "text",
2213
+ "primaryKey": false,
2214
+ "notNull": true,
2215
+ "autoincrement": false
2216
+ },
2217
+ "status": {
2218
+ "name": "status",
2219
+ "type": "text",
2220
+ "primaryKey": false,
2221
+ "notNull": true,
2222
+ "autoincrement": false,
2223
+ "default": "'pending'"
2224
+ },
2225
+ "expires_at": {
2226
+ "name": "expires_at",
2227
+ "type": "text",
2228
+ "primaryKey": false,
2229
+ "notNull": true,
2230
+ "autoincrement": false
2231
+ },
2232
+ "accepted_at": {
2233
+ "name": "accepted_at",
2234
+ "type": "text",
2235
+ "primaryKey": false,
2236
+ "notNull": false,
2237
+ "autoincrement": false
2238
+ },
2239
+ "created_at": {
2240
+ "name": "created_at",
2241
+ "type": "text",
2242
+ "primaryKey": false,
2243
+ "notNull": true,
2244
+ "autoincrement": false
2245
+ }
2246
+ },
2247
+ "indexes": {
2248
+ "tenant_invitations_token_unique": {
2249
+ "name": "tenant_invitations_token_unique",
2250
+ "columns": ["token"],
2251
+ "isUnique": true
2252
+ }
2253
+ },
2254
+ "foreignKeys": {
2255
+ "tenant_invitations_tenant_id_tenants_id_fk": {
2256
+ "name": "tenant_invitations_tenant_id_tenants_id_fk",
2257
+ "tableFrom": "tenant_invitations",
2258
+ "tableTo": "tenants",
2259
+ "columnsFrom": ["tenant_id"],
2260
+ "columnsTo": ["id"],
2261
+ "onDelete": "cascade",
2262
+ "onUpdate": "no action"
2263
+ },
2264
+ "tenant_invitations_role_id_tenant_roles_id_fk": {
2265
+ "name": "tenant_invitations_role_id_tenant_roles_id_fk",
2266
+ "tableFrom": "tenant_invitations",
2267
+ "tableTo": "tenant_roles",
2268
+ "columnsFrom": ["role_id"],
2269
+ "columnsTo": ["id"],
2270
+ "onDelete": "cascade",
2271
+ "onUpdate": "no action"
2272
+ }
2273
+ },
2274
+ "compositePrimaryKeys": {},
2275
+ "uniqueConstraints": {},
2276
+ "checkConstraints": {}
2277
+ },
2278
+ "merchants": {
2279
+ "name": "merchants",
2280
+ "columns": {
2281
+ "id": {
2282
+ "name": "id",
2283
+ "type": "integer",
2284
+ "primaryKey": true,
2285
+ "notNull": true,
2286
+ "autoincrement": true
2287
+ },
2288
+ "user_id": {
2289
+ "name": "user_id",
2290
+ "type": "text",
2291
+ "primaryKey": false,
2292
+ "notNull": true,
2293
+ "autoincrement": false
2294
+ },
2295
+ "tenant_id": {
2296
+ "name": "tenant_id",
2297
+ "type": "integer",
2298
+ "primaryKey": false,
2299
+ "notNull": true,
2300
+ "autoincrement": false
2301
+ },
2302
+ "business_name": {
2303
+ "name": "business_name",
2304
+ "type": "text",
2305
+ "primaryKey": false,
2306
+ "notNull": true,
2307
+ "autoincrement": false
2308
+ },
2309
+ "business_type": {
2310
+ "name": "business_type",
2311
+ "type": "text",
2312
+ "primaryKey": false,
2313
+ "notNull": true,
2314
+ "autoincrement": false,
2315
+ "default": "'retail'"
2316
+ },
2317
+ "status": {
2318
+ "name": "status",
2319
+ "type": "text",
2320
+ "primaryKey": false,
2321
+ "notNull": true,
2322
+ "autoincrement": false,
2323
+ "default": "'active'"
2324
+ },
2325
+ "description": {
2326
+ "name": "description",
2327
+ "type": "text",
2328
+ "primaryKey": false,
2329
+ "notNull": false,
2330
+ "autoincrement": false
2331
+ },
2332
+ "phone": {
2333
+ "name": "phone",
2334
+ "type": "text",
2335
+ "primaryKey": false,
2336
+ "notNull": false,
2337
+ "autoincrement": false
2338
+ },
2339
+ "email": {
2340
+ "name": "email",
2341
+ "type": "text",
2342
+ "primaryKey": false,
2343
+ "notNull": false,
2344
+ "autoincrement": false
2345
+ },
2346
+ "address": {
2347
+ "name": "address",
2348
+ "type": "text",
2349
+ "primaryKey": false,
2350
+ "notNull": false,
2351
+ "autoincrement": false
2352
+ },
2353
+ "password": {
2354
+ "name": "password",
2355
+ "type": "text",
2356
+ "primaryKey": false,
2357
+ "notNull": true,
2358
+ "autoincrement": false
2359
+ },
2360
+ "created_at": {
2361
+ "name": "created_at",
2362
+ "type": "text",
2363
+ "primaryKey": false,
2364
+ "notNull": true,
2365
+ "autoincrement": false
2366
+ },
2367
+ "updated_at": {
2368
+ "name": "updated_at",
2369
+ "type": "text",
2370
+ "primaryKey": false,
2371
+ "notNull": true,
2372
+ "autoincrement": false
2373
+ }
2374
+ },
2375
+ "indexes": {},
2376
+ "foreignKeys": {},
2377
+ "compositePrimaryKeys": {},
2378
+ "uniqueConstraints": {},
2379
+ "checkConstraints": {}
2380
+ },
2381
+ "products": {
2382
+ "name": "products",
2383
+ "columns": {
2384
+ "id": {
2385
+ "name": "id",
2386
+ "type": "text",
2387
+ "primaryKey": true,
2388
+ "notNull": true,
2389
+ "autoincrement": false
2390
+ },
2391
+ "name": {
2392
+ "name": "name",
2393
+ "type": "text",
2394
+ "primaryKey": false,
2395
+ "notNull": true,
2396
+ "autoincrement": false
2397
+ },
2398
+ "description": {
2399
+ "name": "description",
2400
+ "type": "text",
2401
+ "primaryKey": false,
2402
+ "notNull": false,
2403
+ "autoincrement": false
2404
+ },
2405
+ "price": {
2406
+ "name": "price",
2407
+ "type": "integer",
2408
+ "primaryKey": false,
2409
+ "notNull": true,
2410
+ "autoincrement": false
2411
+ },
2412
+ "status": {
2413
+ "name": "status",
2414
+ "type": "text",
2415
+ "primaryKey": false,
2416
+ "notNull": true,
2417
+ "autoincrement": false,
2418
+ "default": "'active'"
2419
+ },
2420
+ "stock": {
2421
+ "name": "stock",
2422
+ "type": "integer",
2423
+ "primaryKey": false,
2424
+ "notNull": true,
2425
+ "autoincrement": false,
2426
+ "default": 0
2427
+ },
2428
+ "image_url": {
2429
+ "name": "image_url",
2430
+ "type": "text",
2431
+ "primaryKey": false,
2432
+ "notNull": false,
2433
+ "autoincrement": false
2434
+ },
2435
+ "merchant_id": {
2436
+ "name": "merchant_id",
2437
+ "type": "integer",
2438
+ "primaryKey": false,
2439
+ "notNull": true,
2440
+ "autoincrement": false
2441
+ },
2442
+ "created_at": {
2443
+ "name": "created_at",
2444
+ "type": "integer",
2445
+ "primaryKey": false,
2446
+ "notNull": true,
2447
+ "autoincrement": false,
2448
+ "default": "(unixepoch() * 1000)"
2449
+ },
2450
+ "updated_at": {
2451
+ "name": "updated_at",
2452
+ "type": "integer",
2453
+ "primaryKey": false,
2454
+ "notNull": true,
2455
+ "autoincrement": false,
2456
+ "default": "(unixepoch() * 1000)"
2457
+ }
2458
+ },
2459
+ "indexes": {
2460
+ "products_status_idx": {
2461
+ "name": "products_status_idx",
2462
+ "columns": ["status"],
2463
+ "isUnique": false
2464
+ },
2465
+ "products_merchant_id_idx": {
2466
+ "name": "products_merchant_id_idx",
2467
+ "columns": ["merchant_id"],
2468
+ "isUnique": false
2469
+ }
2470
+ },
2471
+ "foreignKeys": {},
2472
+ "compositePrimaryKeys": {},
2473
+ "uniqueConstraints": {},
2474
+ "checkConstraints": {}
2475
+ }
2476
+ },
2477
+ "views": {},
2478
+ "enums": {},
2479
+ "_meta": {
2480
+ "schemas": {},
2481
+ "tables": {},
2482
+ "columns": {}
2483
+ },
2484
+ "internal": {
2485
+ "indexes": {}
2486
+ }
2487
+ }