-
Notifications
You must be signed in to change notification settings - Fork 395
feat(worktree): add per-task DB target env #941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ALTER TABLE `tasks` ADD COLUMN `db_target` text; | ||
| --> statement-breakpoint | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,7 @@ export function registerWorktreeIpc(): void { | |
| taskName: string; | ||
| projectId: string; | ||
| baseRef?: string; | ||
| dbTarget?: string | null; | ||
| } | ||
| ) => { | ||
| try { | ||
|
|
@@ -103,6 +104,7 @@ export function registerWorktreeIpc(): void { | |
| projectId: project.id, | ||
| status: 'active' as const, | ||
| createdAt: new Date().toISOString(), | ||
| dbTarget: args.dbTarget ?? null, | ||
| }; | ||
| return { success: true, worktree }; | ||
| } | ||
|
|
@@ -113,7 +115,7 @@ export function registerWorktreeIpc(): void { | |
| args.projectId, | ||
| args.baseRef | ||
| ); | ||
| return { success: true, worktree }; | ||
| return { success: true, worktree: { ...worktree, dbTarget: args.dbTarget ?? null } }; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For the local (non-remote) worktree creation path, This works at runtime because Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
| } catch (error) { | ||
| console.error('Failed to create worktree:', error); | ||
| return { success: false, error: (error as Error).message }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually created migration file
This migration file was created manually without running
drizzle-kit generate. Thedrizzle/meta/_journal.jsonhas no entry for0010_add_db_target_to_tasks(it stops at idx 9 /0009_add_ssh_support), and there is no corresponding snapshot file indrizzle/meta/.Per the project's critical rules in
CLAUDE.md: "NEVER modifydrizzle/meta/or numbered migration files — always usedrizzle-kit generate". While this rule focuses on modifying existing files, the intended workflow is to always generate migrations viadrizzle-kit generateafter modifyingschema.ts. A hand-written migration without the journal/snapshot metadata will cause Drizzle's migration runner to skip this file, meaning thedb_targetcolumn will never be added to existing databases.Please run
pnpm exec drizzle-kit generateafter the schema change to produce a properly tracked migration.Context Used: Context from
dashboard- CLAUDE.md (source)