diff --git a/apps/server/src/persistence/Layers/ProjectionProjects.ts b/apps/server/src/persistence/Layers/ProjectionProjects.ts index 4eacf84056..b31bb5c9a5 100644 --- a/apps/server/src/persistence/Layers/ProjectionProjects.ts +++ b/apps/server/src/persistence/Layers/ProjectionProjects.ts @@ -32,7 +32,6 @@ const makeProjectionProjectRepository = Effect.gen(function* () { project_id, title, workspace_root, - pinned, pinned_at, default_model_selection_json, scripts_json, @@ -44,7 +43,6 @@ const makeProjectionProjectRepository = Effect.gen(function* () { ${row.projectId}, ${row.title}, ${row.workspaceRoot}, - ${row.pinnedAt !== null ? 1 : 0}, ${row.pinnedAt}, ${row.defaultModelSelection !== null ? JSON.stringify(row.defaultModelSelection) : null}, ${JSON.stringify(row.scripts)}, @@ -56,7 +54,6 @@ const makeProjectionProjectRepository = Effect.gen(function* () { DO UPDATE SET title = excluded.title, workspace_root = excluded.workspace_root, - pinned = excluded.pinned, pinned_at = excluded.pinned_at, default_model_selection_json = excluded.default_model_selection_json, scripts_json = excluded.scripts_json, diff --git a/apps/server/src/persistence/Layers/ProjectionThreads.ts b/apps/server/src/persistence/Layers/ProjectionThreads.ts index a06a5f187b..e65cea7ada 100644 --- a/apps/server/src/persistence/Layers/ProjectionThreads.ts +++ b/apps/server/src/persistence/Layers/ProjectionThreads.ts @@ -32,7 +32,6 @@ const makeProjectionThreadRepository = Effect.gen(function* () { thread_id, project_id, title, - pinned, pinned_at, model_selection_json, runtime_mode, @@ -49,7 +48,6 @@ const makeProjectionThreadRepository = Effect.gen(function* () { ${row.threadId}, ${row.projectId}, ${row.title}, - ${row.pinnedAt !== null ? 1 : 0}, ${row.pinnedAt}, ${JSON.stringify(row.modelSelection)}, ${row.runtimeMode}, @@ -66,7 +64,6 @@ const makeProjectionThreadRepository = Effect.gen(function* () { DO UPDATE SET project_id = excluded.project_id, title = excluded.title, - pinned = excluded.pinned, pinned_at = excluded.pinned_at, model_selection_json = excluded.model_selection_json, runtime_mode = excluded.runtime_mode, diff --git a/apps/server/src/persistence/Migrations.ts b/apps/server/src/persistence/Migrations.ts index 4750273549..6827c42b20 100644 --- a/apps/server/src/persistence/Migrations.ts +++ b/apps/server/src/persistence/Migrations.ts @@ -32,7 +32,6 @@ import Migration0016 from "./Migrations/016_CanonicalizeModelSelections.ts"; import Migration0017 from "./Migrations/017_ProjectionThreadsArchivedAt.ts"; import Migration0018 from "./Migrations/018_ProjectionThreadsArchivedAtIndex.ts"; import Migration0019 from "./Migrations/019_ProjectionPins.ts"; -import Migration0020 from "./Migrations/020_ProjectionPinTimestamps.ts"; /** * Migration loader with all migrations defined inline. @@ -64,7 +63,6 @@ export const migrationEntries = [ [17, "ProjectionThreadsArchivedAt", Migration0017], [18, "ProjectionThreadsArchivedAtIndex", Migration0018], [19, "ProjectionPins", Migration0019], - [20, "ProjectionPinTimestamps", Migration0020], ] as const; export const makeMigrationLoader = (throughId?: number) => diff --git a/apps/server/src/persistence/Migrations/005_Projections.ts b/apps/server/src/persistence/Migrations/005_Projections.ts index f92abf6d4a..c950da76a1 100644 --- a/apps/server/src/persistence/Migrations/005_Projections.ts +++ b/apps/server/src/persistence/Migrations/005_Projections.ts @@ -9,7 +9,6 @@ export default Effect.gen(function* () { project_id TEXT PRIMARY KEY, title TEXT NOT NULL, workspace_root TEXT NOT NULL, - pinned INTEGER NOT NULL DEFAULT 0, default_model TEXT, scripts_json TEXT NOT NULL, created_at TEXT NOT NULL, @@ -23,7 +22,6 @@ export default Effect.gen(function* () { thread_id TEXT PRIMARY KEY, project_id TEXT NOT NULL, title TEXT NOT NULL, - pinned INTEGER NOT NULL DEFAULT 0, model TEXT NOT NULL, branch TEXT, worktree_path TEXT, diff --git a/apps/server/src/persistence/Migrations/019_ProjectionPins.ts b/apps/server/src/persistence/Migrations/019_ProjectionPins.ts index f2ecca3ce9..257a31e5e1 100644 --- a/apps/server/src/persistence/Migrations/019_ProjectionPins.ts +++ b/apps/server/src/persistence/Migrations/019_ProjectionPins.ts @@ -7,20 +7,20 @@ export default Effect.gen(function* () { const projectColumns = yield* sql<{ readonly name: string }>` PRAGMA table_info(projection_projects) `; - if (!projectColumns.some((column) => column.name === "pinned")) { + if (!projectColumns.some((column) => column.name === "pinned_at")) { yield* sql` ALTER TABLE projection_projects - ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0 + ADD COLUMN pinned_at TEXT `; } const threadColumns = yield* sql<{ readonly name: string }>` PRAGMA table_info(projection_threads) `; - if (!threadColumns.some((column) => column.name === "pinned")) { + if (!threadColumns.some((column) => column.name === "pinned_at")) { yield* sql` ALTER TABLE projection_threads - ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0 + ADD COLUMN pinned_at TEXT `; } }); diff --git a/apps/server/src/persistence/Migrations/020_ProjectionPinTimestamps.ts b/apps/server/src/persistence/Migrations/020_ProjectionPinTimestamps.ts deleted file mode 100644 index 5bef1a75f1..0000000000 --- a/apps/server/src/persistence/Migrations/020_ProjectionPinTimestamps.ts +++ /dev/null @@ -1,38 +0,0 @@ -import * as Effect from "effect/Effect"; -import * as SqlClient from "effect/unstable/sql/SqlClient"; - -export default Effect.gen(function* () { - const sql = yield* SqlClient.SqlClient; - - const projectColumns = yield* sql<{ readonly name: string }>` - PRAGMA table_info(projection_projects) - `; - if (!projectColumns.some((column) => column.name === "pinned_at")) { - yield* sql` - ALTER TABLE projection_projects - ADD COLUMN pinned_at TEXT - `; - } - - yield* sql` - UPDATE projection_projects - SET pinned_at = CASE WHEN pinned != 0 THEN updated_at ELSE NULL END - WHERE pinned_at IS NULL - `; - - const threadColumns = yield* sql<{ readonly name: string }>` - PRAGMA table_info(projection_threads) - `; - if (!threadColumns.some((column) => column.name === "pinned_at")) { - yield* sql` - ALTER TABLE projection_threads - ADD COLUMN pinned_at TEXT - `; - } - - yield* sql` - UPDATE projection_threads - SET pinned_at = CASE WHEN pinned != 0 THEN updated_at ELSE NULL END - WHERE pinned_at IS NULL - `; -}); diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index b2428471c0..200569500e 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -1742,7 +1742,7 @@ export default function Sidebar() {