@lobehub/lobehub 2.0.0-next.352 → 2.0.0-next.353
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.
- package/CHANGELOG.md +25 -0
- package/changelog/v1.json +5 -0
- package/docs/development/database-schema.dbml +5 -0
- package/package.json +1 -1
- package/packages/database/migrations/0071_add_async_task_extend.sql +5 -0
- package/packages/database/migrations/meta/0071_snapshot.json +10720 -0
- package/packages/database/migrations/meta/_journal.json +7 -0
- package/packages/database/src/schemas/asyncTask.ts +12 -2
|
@@ -497,6 +497,13 @@
|
|
|
497
497
|
"when": 1768999498635,
|
|
498
498
|
"tag": "0070_add_user_memory_activities",
|
|
499
499
|
"breakpoints": true
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"idx": 71,
|
|
503
|
+
"version": "7",
|
|
504
|
+
"when": 1769093425330,
|
|
505
|
+
"tag": "0071_add_async_task_extend",
|
|
506
|
+
"breakpoints": true
|
|
500
507
|
}
|
|
501
508
|
],
|
|
502
509
|
"version": "6"
|
|
@@ -17,11 +17,21 @@ export const asyncTasks = pgTable(
|
|
|
17
17
|
.references(() => users.id, { onDelete: 'cascade' })
|
|
18
18
|
.notNull(),
|
|
19
19
|
duration: integer('duration'),
|
|
20
|
+
parentId: uuid('parent_id'),
|
|
21
|
+
metadata: jsonb('metadata').notNull().default('{}'),
|
|
20
22
|
|
|
21
23
|
...timestamps,
|
|
22
24
|
},
|
|
23
|
-
(t) => [
|
|
25
|
+
(t) => [
|
|
26
|
+
index('async_tasks_user_id_idx').on(t.userId),
|
|
27
|
+
index('async_tasks_parent_id_idx').on(t.parentId),
|
|
28
|
+
index('async_tasks_type_status_idx').on(t.type, t.status),
|
|
29
|
+
index('async_tasks_metadata_idx').using(
|
|
30
|
+
'gin',
|
|
31
|
+
t.metadata,
|
|
32
|
+
)
|
|
33
|
+
],
|
|
24
34
|
);
|
|
25
35
|
|
|
26
36
|
export type NewAsyncTaskItem = typeof asyncTasks.$inferInsert;
|
|
27
|
-
export type AsyncTaskSelectItem = typeof asyncTasks.$inferSelect
|
|
37
|
+
export type AsyncTaskSelectItem = Omit<typeof asyncTasks.$inferSelect, 'metadata' | 'parentId'> & Partial<Pick<typeof asyncTasks.$inferSelect, 'metadata' | 'parentId'>>;
|