Skip to content

fix(desktop): resolve migration idempotency for 11 by making it noop and using a new col#826

Merged
Kitenite merged 3 commits into
mainfrom
solve-idempotency
Jan 19, 2026
Merged

fix(desktop): resolve migration idempotency for 11 by making it noop and using a new col#826
Kitenite merged 3 commits into
mainfrom
solve-idempotency

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Jan 19, 2026

Summary

  • Makes migration 0011 a no-op (SELECT 1) to avoid duplicate column error for users who already had terminal_persistence
  • Adds migration 0012 with new column name persist_terminal (with DEFAULT true)
  • Renames schema field from terminalPersistence to persistTerminal
  • Changes default value from false to true

Test plan

  • Fresh install: migrations 0011 (no-op) and 0012 run successfully
  • Existing user with terminal_persistence column: migration 0011 skips, 0012 adds new column
  • Terminal persistence setting works correctly with new column name
  • Default value is true for new installations

Summary by CodeRabbit

  • Chores
    • Terminal persistence is now enabled by default.

✏️ Tip: You can customize this high-level summary in your review settings.

…istence column

The migration 0011 failed on app start for users who already had the
terminal_persistence column. This fix:

- Makes migration 0011 a no-op (SELECT 1) to avoid duplicate column error
- Adds migration 0012 with new column name `persist_terminal`
- Renames schema field from `terminalPersistence` to `persistTerminal`
- Changes default value from false to true
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 19, 2026

📝 Walkthrough

Walkthrough

The changes rename the terminal persistence database column from terminal_persistence to persist_terminal, convert the initial migration to a no-op to resolve idempotency issues, introduce a new migration adding the renamed column with a true default, and update the corresponding desktop constant and schema definition.

Changes

Cohort / File(s) Summary
Desktop Application Settings
apps/desktop/src/shared/constants.ts
Updated DEFAULT_TERMINAL_PERSISTENCE constant from false to true
Database Migrations
packages/local-db/drizzle/0011_add_terminal_persistence.sql, packages/local-db/drizzle/0012_add_persist_terminal.sql
Converted 0011 to a no-op migration with explanatory comments; introduced 0012 adding persist_terminal column to settings table as integer with default true
Migration Metadata & Journal
packages/local-db/drizzle/meta/0011_snapshot.json, packages/local-db/drizzle/meta/0012_snapshot.json, packages/local-db/drizzle/meta/_journal.json
Removed terminal_persistence column from 0011 snapshot; added comprehensive 0012 schema snapshot with full database structure (tables: organization_members, organizations, projects, settings, tasks, users, workspaces, worktrees); added migration journal entry for 0012
Schema Definition
packages/local-db/src/schema/schema.ts
Renamed terminalPersistence column definition from terminal_persistence to persist_terminal with added default(true) constraint

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A migration made anew,
When idempotency rings true,
Persist\_terminal, with default bright,
The terminal now remembers right! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is incomplete compared to the template. It lacks sections for Related Issues, Type of Change, Testing, Screenshots, and Additional Notes. Fill in the missing template sections, particularly the Type of Change checkbox and more detailed Testing section with step-by-step verification instructions.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: resolving migration idempotency by making migration 0011 a no-op and introducing a new column.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Kitenite Kitenite changed the title fix(desktop): resolve migration idempotency by renaming terminal_persistence column fix(desktop): resolve migration idempotency for 11 by making it noop and using a new col Jan 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 19, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch
  • ✅ Electric Fly.io app

Thank you for your contribution! 🎉

@Kitenite Kitenite merged commit 7a3e719 into main Jan 19, 2026
13 checks passed
@Kitenite Kitenite deleted the solve-idempotency branch January 19, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant