tangled
alpha
login
or
join now
cosmik.network
/
semble
43
fork
atom
A social knowledge tool for researchers built on ATProto
43
fork
atom
overview
issues
13
pulls
pipelines
fresh migration files
Wesley Finck
8 months ago
59b789cd
43dbba68
+764
3 changed files
expand all
collapse all
unified
split
src
shared
infrastructure
database
migrations
0000_shocking_fenris.sql
meta
0000_snapshot.json
_journal.json
+94
src/shared/infrastructure/database/migrations/0000_shocking_fenris.sql
···
1
1
+
CREATE TABLE "cards" (
2
2
+
"id" uuid PRIMARY KEY NOT NULL,
3
3
+
"type" text NOT NULL,
4
4
+
"content_data" jsonb NOT NULL,
5
5
+
"url" text,
6
6
+
"parent_card_id" uuid,
7
7
+
"original_published_record_id" uuid,
8
8
+
"library_count" integer DEFAULT 0 NOT NULL,
9
9
+
"created_at" timestamp DEFAULT now() NOT NULL,
10
10
+
"updated_at" timestamp DEFAULT now() NOT NULL
11
11
+
);
12
12
+
--> statement-breakpoint
13
13
+
CREATE TABLE "collection_cards" (
14
14
+
"id" uuid PRIMARY KEY NOT NULL,
15
15
+
"collection_id" uuid NOT NULL,
16
16
+
"card_id" uuid NOT NULL,
17
17
+
"added_by" text NOT NULL,
18
18
+
"added_at" timestamp DEFAULT now() NOT NULL,
19
19
+
"published_record_id" uuid
20
20
+
);
21
21
+
--> statement-breakpoint
22
22
+
CREATE TABLE "collection_collaborators" (
23
23
+
"id" uuid PRIMARY KEY NOT NULL,
24
24
+
"collection_id" uuid NOT NULL,
25
25
+
"collaborator_id" text NOT NULL
26
26
+
);
27
27
+
--> statement-breakpoint
28
28
+
CREATE TABLE "collections" (
29
29
+
"id" uuid PRIMARY KEY NOT NULL,
30
30
+
"author_id" text NOT NULL,
31
31
+
"name" text NOT NULL,
32
32
+
"description" text,
33
33
+
"access_type" text NOT NULL,
34
34
+
"card_count" integer DEFAULT 0 NOT NULL,
35
35
+
"created_at" timestamp DEFAULT now() NOT NULL,
36
36
+
"updated_at" timestamp DEFAULT now() NOT NULL,
37
37
+
"published_record_id" uuid
38
38
+
);
39
39
+
--> statement-breakpoint
40
40
+
CREATE TABLE "library_memberships" (
41
41
+
"card_id" uuid NOT NULL,
42
42
+
"user_id" text NOT NULL,
43
43
+
"added_at" timestamp DEFAULT now() NOT NULL,
44
44
+
"published_record_id" uuid,
45
45
+
CONSTRAINT "library_memberships_card_id_user_id_pk" PRIMARY KEY("card_id","user_id")
46
46
+
);
47
47
+
--> statement-breakpoint
48
48
+
CREATE TABLE "published_records" (
49
49
+
"id" uuid PRIMARY KEY NOT NULL,
50
50
+
"uri" text NOT NULL,
51
51
+
"cid" text NOT NULL,
52
52
+
"recorded_at" timestamp DEFAULT now() NOT NULL
53
53
+
);
54
54
+
--> statement-breakpoint
55
55
+
CREATE TABLE "auth_session" (
56
56
+
"key" text PRIMARY KEY NOT NULL,
57
57
+
"session" text NOT NULL
58
58
+
);
59
59
+
--> statement-breakpoint
60
60
+
CREATE TABLE "auth_state" (
61
61
+
"key" text PRIMARY KEY NOT NULL,
62
62
+
"state" text NOT NULL,
63
63
+
"created_at" timestamp DEFAULT now()
64
64
+
);
65
65
+
--> statement-breakpoint
66
66
+
CREATE TABLE "auth_refresh_tokens" (
67
67
+
"token_id" text PRIMARY KEY NOT NULL,
68
68
+
"user_did" text NOT NULL,
69
69
+
"refresh_token" text NOT NULL,
70
70
+
"issued_at" timestamp NOT NULL,
71
71
+
"expires_at" timestamp NOT NULL,
72
72
+
"revoked" boolean DEFAULT false
73
73
+
);
74
74
+
--> statement-breakpoint
75
75
+
CREATE TABLE "users" (
76
76
+
"id" text PRIMARY KEY NOT NULL,
77
77
+
"handle" text,
78
78
+
"linked_at" timestamp NOT NULL,
79
79
+
"last_login_at" timestamp NOT NULL
80
80
+
);
81
81
+
--> statement-breakpoint
82
82
+
ALTER TABLE "cards" ADD CONSTRAINT "cards_parent_card_id_cards_id_fk" FOREIGN KEY ("parent_card_id") REFERENCES "public"."cards"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
83
83
+
ALTER TABLE "cards" ADD CONSTRAINT "cards_original_published_record_id_published_records_id_fk" FOREIGN KEY ("original_published_record_id") REFERENCES "public"."published_records"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
84
84
+
ALTER TABLE "collection_cards" ADD CONSTRAINT "collection_cards_collection_id_collections_id_fk" FOREIGN KEY ("collection_id") REFERENCES "public"."collections"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
85
85
+
ALTER TABLE "collection_cards" ADD CONSTRAINT "collection_cards_card_id_cards_id_fk" FOREIGN KEY ("card_id") REFERENCES "public"."cards"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
86
86
+
ALTER TABLE "collection_cards" ADD CONSTRAINT "collection_cards_published_record_id_published_records_id_fk" FOREIGN KEY ("published_record_id") REFERENCES "public"."published_records"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
87
87
+
ALTER TABLE "collection_collaborators" ADD CONSTRAINT "collection_collaborators_collection_id_collections_id_fk" FOREIGN KEY ("collection_id") REFERENCES "public"."collections"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
88
88
+
ALTER TABLE "collections" ADD CONSTRAINT "collections_published_record_id_published_records_id_fk" FOREIGN KEY ("published_record_id") REFERENCES "public"."published_records"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
89
89
+
ALTER TABLE "library_memberships" ADD CONSTRAINT "library_memberships_card_id_cards_id_fk" FOREIGN KEY ("card_id") REFERENCES "public"."cards"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
90
90
+
ALTER TABLE "library_memberships" ADD CONSTRAINT "library_memberships_published_record_id_published_records_id_fk" FOREIGN KEY ("published_record_id") REFERENCES "public"."published_records"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
91
91
+
ALTER TABLE "auth_refresh_tokens" ADD CONSTRAINT "auth_refresh_tokens_user_did_users_id_fk" FOREIGN KEY ("user_did") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
92
92
+
CREATE INDEX "idx_user_cards" ON "library_memberships" USING btree ("user_id");--> statement-breakpoint
93
93
+
CREATE INDEX "idx_card_users" ON "library_memberships" USING btree ("card_id");--> statement-breakpoint
94
94
+
CREATE UNIQUE INDEX "uri_cid_unique_idx" ON "published_records" USING btree ("uri","cid");
+657
src/shared/infrastructure/database/migrations/meta/0000_snapshot.json
···
1
1
+
{
2
2
+
"id": "6b0a9801-bc78-4b56-828f-a2e4648fa0dc",
3
3
+
"prevId": "00000000-0000-0000-0000-000000000000",
4
4
+
"version": "7",
5
5
+
"dialect": "postgresql",
6
6
+
"tables": {
7
7
+
"public.cards": {
8
8
+
"name": "cards",
9
9
+
"schema": "",
10
10
+
"columns": {
11
11
+
"id": {
12
12
+
"name": "id",
13
13
+
"type": "uuid",
14
14
+
"primaryKey": true,
15
15
+
"notNull": true
16
16
+
},
17
17
+
"type": {
18
18
+
"name": "type",
19
19
+
"type": "text",
20
20
+
"primaryKey": false,
21
21
+
"notNull": true
22
22
+
},
23
23
+
"content_data": {
24
24
+
"name": "content_data",
25
25
+
"type": "jsonb",
26
26
+
"primaryKey": false,
27
27
+
"notNull": true
28
28
+
},
29
29
+
"url": {
30
30
+
"name": "url",
31
31
+
"type": "text",
32
32
+
"primaryKey": false,
33
33
+
"notNull": false
34
34
+
},
35
35
+
"parent_card_id": {
36
36
+
"name": "parent_card_id",
37
37
+
"type": "uuid",
38
38
+
"primaryKey": false,
39
39
+
"notNull": false
40
40
+
},
41
41
+
"original_published_record_id": {
42
42
+
"name": "original_published_record_id",
43
43
+
"type": "uuid",
44
44
+
"primaryKey": false,
45
45
+
"notNull": false
46
46
+
},
47
47
+
"library_count": {
48
48
+
"name": "library_count",
49
49
+
"type": "integer",
50
50
+
"primaryKey": false,
51
51
+
"notNull": true,
52
52
+
"default": 0
53
53
+
},
54
54
+
"created_at": {
55
55
+
"name": "created_at",
56
56
+
"type": "timestamp",
57
57
+
"primaryKey": false,
58
58
+
"notNull": true,
59
59
+
"default": "now()"
60
60
+
},
61
61
+
"updated_at": {
62
62
+
"name": "updated_at",
63
63
+
"type": "timestamp",
64
64
+
"primaryKey": false,
65
65
+
"notNull": true,
66
66
+
"default": "now()"
67
67
+
}
68
68
+
},
69
69
+
"indexes": {},
70
70
+
"foreignKeys": {
71
71
+
"cards_parent_card_id_cards_id_fk": {
72
72
+
"name": "cards_parent_card_id_cards_id_fk",
73
73
+
"tableFrom": "cards",
74
74
+
"tableTo": "cards",
75
75
+
"columnsFrom": [
76
76
+
"parent_card_id"
77
77
+
],
78
78
+
"columnsTo": [
79
79
+
"id"
80
80
+
],
81
81
+
"onDelete": "no action",
82
82
+
"onUpdate": "no action"
83
83
+
},
84
84
+
"cards_original_published_record_id_published_records_id_fk": {
85
85
+
"name": "cards_original_published_record_id_published_records_id_fk",
86
86
+
"tableFrom": "cards",
87
87
+
"tableTo": "published_records",
88
88
+
"columnsFrom": [
89
89
+
"original_published_record_id"
90
90
+
],
91
91
+
"columnsTo": [
92
92
+
"id"
93
93
+
],
94
94
+
"onDelete": "no action",
95
95
+
"onUpdate": "no action"
96
96
+
}
97
97
+
},
98
98
+
"compositePrimaryKeys": {},
99
99
+
"uniqueConstraints": {},
100
100
+
"policies": {},
101
101
+
"checkConstraints": {},
102
102
+
"isRLSEnabled": false
103
103
+
},
104
104
+
"public.collection_cards": {
105
105
+
"name": "collection_cards",
106
106
+
"schema": "",
107
107
+
"columns": {
108
108
+
"id": {
109
109
+
"name": "id",
110
110
+
"type": "uuid",
111
111
+
"primaryKey": true,
112
112
+
"notNull": true
113
113
+
},
114
114
+
"collection_id": {
115
115
+
"name": "collection_id",
116
116
+
"type": "uuid",
117
117
+
"primaryKey": false,
118
118
+
"notNull": true
119
119
+
},
120
120
+
"card_id": {
121
121
+
"name": "card_id",
122
122
+
"type": "uuid",
123
123
+
"primaryKey": false,
124
124
+
"notNull": true
125
125
+
},
126
126
+
"added_by": {
127
127
+
"name": "added_by",
128
128
+
"type": "text",
129
129
+
"primaryKey": false,
130
130
+
"notNull": true
131
131
+
},
132
132
+
"added_at": {
133
133
+
"name": "added_at",
134
134
+
"type": "timestamp",
135
135
+
"primaryKey": false,
136
136
+
"notNull": true,
137
137
+
"default": "now()"
138
138
+
},
139
139
+
"published_record_id": {
140
140
+
"name": "published_record_id",
141
141
+
"type": "uuid",
142
142
+
"primaryKey": false,
143
143
+
"notNull": false
144
144
+
}
145
145
+
},
146
146
+
"indexes": {},
147
147
+
"foreignKeys": {
148
148
+
"collection_cards_collection_id_collections_id_fk": {
149
149
+
"name": "collection_cards_collection_id_collections_id_fk",
150
150
+
"tableFrom": "collection_cards",
151
151
+
"tableTo": "collections",
152
152
+
"columnsFrom": [
153
153
+
"collection_id"
154
154
+
],
155
155
+
"columnsTo": [
156
156
+
"id"
157
157
+
],
158
158
+
"onDelete": "cascade",
159
159
+
"onUpdate": "no action"
160
160
+
},
161
161
+
"collection_cards_card_id_cards_id_fk": {
162
162
+
"name": "collection_cards_card_id_cards_id_fk",
163
163
+
"tableFrom": "collection_cards",
164
164
+
"tableTo": "cards",
165
165
+
"columnsFrom": [
166
166
+
"card_id"
167
167
+
],
168
168
+
"columnsTo": [
169
169
+
"id"
170
170
+
],
171
171
+
"onDelete": "cascade",
172
172
+
"onUpdate": "no action"
173
173
+
},
174
174
+
"collection_cards_published_record_id_published_records_id_fk": {
175
175
+
"name": "collection_cards_published_record_id_published_records_id_fk",
176
176
+
"tableFrom": "collection_cards",
177
177
+
"tableTo": "published_records",
178
178
+
"columnsFrom": [
179
179
+
"published_record_id"
180
180
+
],
181
181
+
"columnsTo": [
182
182
+
"id"
183
183
+
],
184
184
+
"onDelete": "no action",
185
185
+
"onUpdate": "no action"
186
186
+
}
187
187
+
},
188
188
+
"compositePrimaryKeys": {},
189
189
+
"uniqueConstraints": {},
190
190
+
"policies": {},
191
191
+
"checkConstraints": {},
192
192
+
"isRLSEnabled": false
193
193
+
},
194
194
+
"public.collection_collaborators": {
195
195
+
"name": "collection_collaborators",
196
196
+
"schema": "",
197
197
+
"columns": {
198
198
+
"id": {
199
199
+
"name": "id",
200
200
+
"type": "uuid",
201
201
+
"primaryKey": true,
202
202
+
"notNull": true
203
203
+
},
204
204
+
"collection_id": {
205
205
+
"name": "collection_id",
206
206
+
"type": "uuid",
207
207
+
"primaryKey": false,
208
208
+
"notNull": true
209
209
+
},
210
210
+
"collaborator_id": {
211
211
+
"name": "collaborator_id",
212
212
+
"type": "text",
213
213
+
"primaryKey": false,
214
214
+
"notNull": true
215
215
+
}
216
216
+
},
217
217
+
"indexes": {},
218
218
+
"foreignKeys": {
219
219
+
"collection_collaborators_collection_id_collections_id_fk": {
220
220
+
"name": "collection_collaborators_collection_id_collections_id_fk",
221
221
+
"tableFrom": "collection_collaborators",
222
222
+
"tableTo": "collections",
223
223
+
"columnsFrom": [
224
224
+
"collection_id"
225
225
+
],
226
226
+
"columnsTo": [
227
227
+
"id"
228
228
+
],
229
229
+
"onDelete": "cascade",
230
230
+
"onUpdate": "no action"
231
231
+
}
232
232
+
},
233
233
+
"compositePrimaryKeys": {},
234
234
+
"uniqueConstraints": {},
235
235
+
"policies": {},
236
236
+
"checkConstraints": {},
237
237
+
"isRLSEnabled": false
238
238
+
},
239
239
+
"public.collections": {
240
240
+
"name": "collections",
241
241
+
"schema": "",
242
242
+
"columns": {
243
243
+
"id": {
244
244
+
"name": "id",
245
245
+
"type": "uuid",
246
246
+
"primaryKey": true,
247
247
+
"notNull": true
248
248
+
},
249
249
+
"author_id": {
250
250
+
"name": "author_id",
251
251
+
"type": "text",
252
252
+
"primaryKey": false,
253
253
+
"notNull": true
254
254
+
},
255
255
+
"name": {
256
256
+
"name": "name",
257
257
+
"type": "text",
258
258
+
"primaryKey": false,
259
259
+
"notNull": true
260
260
+
},
261
261
+
"description": {
262
262
+
"name": "description",
263
263
+
"type": "text",
264
264
+
"primaryKey": false,
265
265
+
"notNull": false
266
266
+
},
267
267
+
"access_type": {
268
268
+
"name": "access_type",
269
269
+
"type": "text",
270
270
+
"primaryKey": false,
271
271
+
"notNull": true
272
272
+
},
273
273
+
"card_count": {
274
274
+
"name": "card_count",
275
275
+
"type": "integer",
276
276
+
"primaryKey": false,
277
277
+
"notNull": true,
278
278
+
"default": 0
279
279
+
},
280
280
+
"created_at": {
281
281
+
"name": "created_at",
282
282
+
"type": "timestamp",
283
283
+
"primaryKey": false,
284
284
+
"notNull": true,
285
285
+
"default": "now()"
286
286
+
},
287
287
+
"updated_at": {
288
288
+
"name": "updated_at",
289
289
+
"type": "timestamp",
290
290
+
"primaryKey": false,
291
291
+
"notNull": true,
292
292
+
"default": "now()"
293
293
+
},
294
294
+
"published_record_id": {
295
295
+
"name": "published_record_id",
296
296
+
"type": "uuid",
297
297
+
"primaryKey": false,
298
298
+
"notNull": false
299
299
+
}
300
300
+
},
301
301
+
"indexes": {},
302
302
+
"foreignKeys": {
303
303
+
"collections_published_record_id_published_records_id_fk": {
304
304
+
"name": "collections_published_record_id_published_records_id_fk",
305
305
+
"tableFrom": "collections",
306
306
+
"tableTo": "published_records",
307
307
+
"columnsFrom": [
308
308
+
"published_record_id"
309
309
+
],
310
310
+
"columnsTo": [
311
311
+
"id"
312
312
+
],
313
313
+
"onDelete": "no action",
314
314
+
"onUpdate": "no action"
315
315
+
}
316
316
+
},
317
317
+
"compositePrimaryKeys": {},
318
318
+
"uniqueConstraints": {},
319
319
+
"policies": {},
320
320
+
"checkConstraints": {},
321
321
+
"isRLSEnabled": false
322
322
+
},
323
323
+
"public.library_memberships": {
324
324
+
"name": "library_memberships",
325
325
+
"schema": "",
326
326
+
"columns": {
327
327
+
"card_id": {
328
328
+
"name": "card_id",
329
329
+
"type": "uuid",
330
330
+
"primaryKey": false,
331
331
+
"notNull": true
332
332
+
},
333
333
+
"user_id": {
334
334
+
"name": "user_id",
335
335
+
"type": "text",
336
336
+
"primaryKey": false,
337
337
+
"notNull": true
338
338
+
},
339
339
+
"added_at": {
340
340
+
"name": "added_at",
341
341
+
"type": "timestamp",
342
342
+
"primaryKey": false,
343
343
+
"notNull": true,
344
344
+
"default": "now()"
345
345
+
},
346
346
+
"published_record_id": {
347
347
+
"name": "published_record_id",
348
348
+
"type": "uuid",
349
349
+
"primaryKey": false,
350
350
+
"notNull": false
351
351
+
}
352
352
+
},
353
353
+
"indexes": {
354
354
+
"idx_user_cards": {
355
355
+
"name": "idx_user_cards",
356
356
+
"columns": [
357
357
+
{
358
358
+
"expression": "user_id",
359
359
+
"isExpression": false,
360
360
+
"asc": true,
361
361
+
"nulls": "last"
362
362
+
}
363
363
+
],
364
364
+
"isUnique": false,
365
365
+
"concurrently": false,
366
366
+
"method": "btree",
367
367
+
"with": {}
368
368
+
},
369
369
+
"idx_card_users": {
370
370
+
"name": "idx_card_users",
371
371
+
"columns": [
372
372
+
{
373
373
+
"expression": "card_id",
374
374
+
"isExpression": false,
375
375
+
"asc": true,
376
376
+
"nulls": "last"
377
377
+
}
378
378
+
],
379
379
+
"isUnique": false,
380
380
+
"concurrently": false,
381
381
+
"method": "btree",
382
382
+
"with": {}
383
383
+
}
384
384
+
},
385
385
+
"foreignKeys": {
386
386
+
"library_memberships_card_id_cards_id_fk": {
387
387
+
"name": "library_memberships_card_id_cards_id_fk",
388
388
+
"tableFrom": "library_memberships",
389
389
+
"tableTo": "cards",
390
390
+
"columnsFrom": [
391
391
+
"card_id"
392
392
+
],
393
393
+
"columnsTo": [
394
394
+
"id"
395
395
+
],
396
396
+
"onDelete": "cascade",
397
397
+
"onUpdate": "no action"
398
398
+
},
399
399
+
"library_memberships_published_record_id_published_records_id_fk": {
400
400
+
"name": "library_memberships_published_record_id_published_records_id_fk",
401
401
+
"tableFrom": "library_memberships",
402
402
+
"tableTo": "published_records",
403
403
+
"columnsFrom": [
404
404
+
"published_record_id"
405
405
+
],
406
406
+
"columnsTo": [
407
407
+
"id"
408
408
+
],
409
409
+
"onDelete": "no action",
410
410
+
"onUpdate": "no action"
411
411
+
}
412
412
+
},
413
413
+
"compositePrimaryKeys": {
414
414
+
"library_memberships_card_id_user_id_pk": {
415
415
+
"name": "library_memberships_card_id_user_id_pk",
416
416
+
"columns": [
417
417
+
"card_id",
418
418
+
"user_id"
419
419
+
]
420
420
+
}
421
421
+
},
422
422
+
"uniqueConstraints": {},
423
423
+
"policies": {},
424
424
+
"checkConstraints": {},
425
425
+
"isRLSEnabled": false
426
426
+
},
427
427
+
"public.published_records": {
428
428
+
"name": "published_records",
429
429
+
"schema": "",
430
430
+
"columns": {
431
431
+
"id": {
432
432
+
"name": "id",
433
433
+
"type": "uuid",
434
434
+
"primaryKey": true,
435
435
+
"notNull": true
436
436
+
},
437
437
+
"uri": {
438
438
+
"name": "uri",
439
439
+
"type": "text",
440
440
+
"primaryKey": false,
441
441
+
"notNull": true
442
442
+
},
443
443
+
"cid": {
444
444
+
"name": "cid",
445
445
+
"type": "text",
446
446
+
"primaryKey": false,
447
447
+
"notNull": true
448
448
+
},
449
449
+
"recorded_at": {
450
450
+
"name": "recorded_at",
451
451
+
"type": "timestamp",
452
452
+
"primaryKey": false,
453
453
+
"notNull": true,
454
454
+
"default": "now()"
455
455
+
}
456
456
+
},
457
457
+
"indexes": {
458
458
+
"uri_cid_unique_idx": {
459
459
+
"name": "uri_cid_unique_idx",
460
460
+
"columns": [
461
461
+
{
462
462
+
"expression": "uri",
463
463
+
"isExpression": false,
464
464
+
"asc": true,
465
465
+
"nulls": "last"
466
466
+
},
467
467
+
{
468
468
+
"expression": "cid",
469
469
+
"isExpression": false,
470
470
+
"asc": true,
471
471
+
"nulls": "last"
472
472
+
}
473
473
+
],
474
474
+
"isUnique": true,
475
475
+
"concurrently": false,
476
476
+
"method": "btree",
477
477
+
"with": {}
478
478
+
}
479
479
+
},
480
480
+
"foreignKeys": {},
481
481
+
"compositePrimaryKeys": {},
482
482
+
"uniqueConstraints": {},
483
483
+
"policies": {},
484
484
+
"checkConstraints": {},
485
485
+
"isRLSEnabled": false
486
486
+
},
487
487
+
"public.auth_session": {
488
488
+
"name": "auth_session",
489
489
+
"schema": "",
490
490
+
"columns": {
491
491
+
"key": {
492
492
+
"name": "key",
493
493
+
"type": "text",
494
494
+
"primaryKey": true,
495
495
+
"notNull": true
496
496
+
},
497
497
+
"session": {
498
498
+
"name": "session",
499
499
+
"type": "text",
500
500
+
"primaryKey": false,
501
501
+
"notNull": true
502
502
+
}
503
503
+
},
504
504
+
"indexes": {},
505
505
+
"foreignKeys": {},
506
506
+
"compositePrimaryKeys": {},
507
507
+
"uniqueConstraints": {},
508
508
+
"policies": {},
509
509
+
"checkConstraints": {},
510
510
+
"isRLSEnabled": false
511
511
+
},
512
512
+
"public.auth_state": {
513
513
+
"name": "auth_state",
514
514
+
"schema": "",
515
515
+
"columns": {
516
516
+
"key": {
517
517
+
"name": "key",
518
518
+
"type": "text",
519
519
+
"primaryKey": true,
520
520
+
"notNull": true
521
521
+
},
522
522
+
"state": {
523
523
+
"name": "state",
524
524
+
"type": "text",
525
525
+
"primaryKey": false,
526
526
+
"notNull": true
527
527
+
},
528
528
+
"created_at": {
529
529
+
"name": "created_at",
530
530
+
"type": "timestamp",
531
531
+
"primaryKey": false,
532
532
+
"notNull": false,
533
533
+
"default": "now()"
534
534
+
}
535
535
+
},
536
536
+
"indexes": {},
537
537
+
"foreignKeys": {},
538
538
+
"compositePrimaryKeys": {},
539
539
+
"uniqueConstraints": {},
540
540
+
"policies": {},
541
541
+
"checkConstraints": {},
542
542
+
"isRLSEnabled": false
543
543
+
},
544
544
+
"public.auth_refresh_tokens": {
545
545
+
"name": "auth_refresh_tokens",
546
546
+
"schema": "",
547
547
+
"columns": {
548
548
+
"token_id": {
549
549
+
"name": "token_id",
550
550
+
"type": "text",
551
551
+
"primaryKey": true,
552
552
+
"notNull": true
553
553
+
},
554
554
+
"user_did": {
555
555
+
"name": "user_did",
556
556
+
"type": "text",
557
557
+
"primaryKey": false,
558
558
+
"notNull": true
559
559
+
},
560
560
+
"refresh_token": {
561
561
+
"name": "refresh_token",
562
562
+
"type": "text",
563
563
+
"primaryKey": false,
564
564
+
"notNull": true
565
565
+
},
566
566
+
"issued_at": {
567
567
+
"name": "issued_at",
568
568
+
"type": "timestamp",
569
569
+
"primaryKey": false,
570
570
+
"notNull": true
571
571
+
},
572
572
+
"expires_at": {
573
573
+
"name": "expires_at",
574
574
+
"type": "timestamp",
575
575
+
"primaryKey": false,
576
576
+
"notNull": true
577
577
+
},
578
578
+
"revoked": {
579
579
+
"name": "revoked",
580
580
+
"type": "boolean",
581
581
+
"primaryKey": false,
582
582
+
"notNull": false,
583
583
+
"default": false
584
584
+
}
585
585
+
},
586
586
+
"indexes": {},
587
587
+
"foreignKeys": {
588
588
+
"auth_refresh_tokens_user_did_users_id_fk": {
589
589
+
"name": "auth_refresh_tokens_user_did_users_id_fk",
590
590
+
"tableFrom": "auth_refresh_tokens",
591
591
+
"tableTo": "users",
592
592
+
"columnsFrom": [
593
593
+
"user_did"
594
594
+
],
595
595
+
"columnsTo": [
596
596
+
"id"
597
597
+
],
598
598
+
"onDelete": "no action",
599
599
+
"onUpdate": "no action"
600
600
+
}
601
601
+
},
602
602
+
"compositePrimaryKeys": {},
603
603
+
"uniqueConstraints": {},
604
604
+
"policies": {},
605
605
+
"checkConstraints": {},
606
606
+
"isRLSEnabled": false
607
607
+
},
608
608
+
"public.users": {
609
609
+
"name": "users",
610
610
+
"schema": "",
611
611
+
"columns": {
612
612
+
"id": {
613
613
+
"name": "id",
614
614
+
"type": "text",
615
615
+
"primaryKey": true,
616
616
+
"notNull": true
617
617
+
},
618
618
+
"handle": {
619
619
+
"name": "handle",
620
620
+
"type": "text",
621
621
+
"primaryKey": false,
622
622
+
"notNull": false
623
623
+
},
624
624
+
"linked_at": {
625
625
+
"name": "linked_at",
626
626
+
"type": "timestamp",
627
627
+
"primaryKey": false,
628
628
+
"notNull": true
629
629
+
},
630
630
+
"last_login_at": {
631
631
+
"name": "last_login_at",
632
632
+
"type": "timestamp",
633
633
+
"primaryKey": false,
634
634
+
"notNull": true
635
635
+
}
636
636
+
},
637
637
+
"indexes": {},
638
638
+
"foreignKeys": {},
639
639
+
"compositePrimaryKeys": {},
640
640
+
"uniqueConstraints": {},
641
641
+
"policies": {},
642
642
+
"checkConstraints": {},
643
643
+
"isRLSEnabled": false
644
644
+
}
645
645
+
},
646
646
+
"enums": {},
647
647
+
"schemas": {},
648
648
+
"sequences": {},
649
649
+
"roles": {},
650
650
+
"policies": {},
651
651
+
"views": {},
652
652
+
"_meta": {
653
653
+
"columns": {},
654
654
+
"schemas": {},
655
655
+
"tables": {}
656
656
+
}
657
657
+
}
+13
src/shared/infrastructure/database/migrations/meta/_journal.json
···
1
1
+
{
2
2
+
"version": "7",
3
3
+
"dialect": "postgresql",
4
4
+
"entries": [
5
5
+
{
6
6
+
"idx": 0,
7
7
+
"version": "7",
8
8
+
"when": 1751588124739,
9
9
+
"tag": "0000_shocking_fenris",
10
10
+
"breakpoints": true
11
11
+
}
12
12
+
]
13
13
+
}