From 1d9a3a6c6b966e766df2561695c172fce83d2f55 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 27 Feb 2026 12:18:26 +0000 Subject: [PATCH] enum and sourceid --- src/app/db/migrations/meta/_journal.json | 7 +++++++ src/app/db/schema/tasks/tasks.ts | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/db/migrations/meta/_journal.json b/src/app/db/migrations/meta/_journal.json index 6df44f68..22bbbee6 100644 --- a/src/app/db/migrations/meta/_journal.json +++ b/src/app/db/migrations/meta/_journal.json @@ -1079,6 +1079,13 @@ "when": 1771757665072, "tag": "0153_large_machine_man", "breakpoints": true + }, + { + "idx": 154, + "version": "7", + "when": 1772194536121, + "tag": "0154_workable_stingray", + "breakpoints": true } ] } \ No newline at end of file diff --git a/src/app/db/schema/tasks/tasks.ts b/src/app/db/schema/tasks/tasks.ts index ae9738b6..e0a1ef34 100644 --- a/src/app/db/schema/tasks/tasks.ts +++ b/src/app/db/schema/tasks/tasks.ts @@ -1,4 +1,6 @@ -import { pgTable, uuid, text, timestamp } from "drizzle-orm/pg-core"; +import { pgTable, uuid, text, timestamp, pgEnum } from "drizzle-orm/pg-core"; + +export const sourceEnum = pgEnum("source", ["portfolio_id"]); export const tasks = pgTable("tasks", { id: uuid("id").defaultRandom().primaryKey(), @@ -12,6 +14,10 @@ export const tasks = pgTable("tasks", { service: text("service"), // e.g. plan, wchg etc + source: sourceEnum("source"), // enum for task source type + + sourceId: text("source_id"), // identifier for the source (e.g., portfolio_id value) + updatedAt: timestamp("updated_at", { precision: 6, withTimezone: true }) .defaultNow() .$onUpdate(() => new Date())