Skip to content

fix(desktop): revert migration 11 to simple ADD COLUMN#824

Merged
saddlepaddle merged 1 commit into
mainfrom
fix/migration-11-idempotent
Jan 19, 2026
Merged

fix(desktop): revert migration 11 to simple ADD COLUMN#824
saddlepaddle merged 1 commit into
mainfrom
fix/migration-11-idempotent

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Jan 19, 2026

Problem

The previous fix (#822) used DROP COLUMN which fails if the column doesn't exist (SQLite doesn't support DROP COLUMN IF EXISTS).

Solution

Revert to simple ALTER TABLE settings ADD terminal_persistence integer;

The existing error handler in apps/desktop/src/main/lib/local-db/index.ts:98-107 already catches "duplicate column name" errors and treats them as idempotent, so this handles both:

  • Fresh installs (column doesn't exist) ✅
  • Partial migrations (column already exists from failed migration) ✅

Migration Change

-- Before (fails if column doesn't exist):
ALTER TABLE \`settings\` DROP COLUMN \`terminal_persistence\`;
ALTER TABLE \`settings\` ADD \`terminal_persistence\` integer;

-- After (idempotent via error handling):
ALTER TABLE \`settings\` ADD \`terminal_persistence\` integer;

Summary by CodeRabbit

  • Chores
    • Version bump and internal database metadata maintenance updates.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 19, 2026

📝 Walkthrough

Walkthrough

This PR applies routine maintenance updates: a version increment for the desktop application package, and metadata adjustments to database migration snapshots and journal timestamps. No functional logic or control flow is modified.

Changes

Cohort / File(s) Summary
Desktop Version Bump
apps/desktop/package.json
Version incremented from 0.0.56 to 0.0.57
Database Migration Metadata
packages/local-db/drizzle/meta/0011_snapshot.json, packages/local-db/drizzle/meta/_journal.json
Snapshot UUID references rotated (id and prevId updated); journal entry timestamp updated from 1768100000000 to 1768790828810

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 A tiny hop, a version bump,
Snapshots shuffle, time moves on,
Database journals tick their song,
0.0.57 hops along! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: reverting migration 11 to a simple ADD COLUMN statement, which is the core objective of the pull request.
Description check ✅ Passed The description provides clear problem/solution structure, explains the migration change with before/after SQL, and references the error handler. However, it does not follow the template structure with sections like Type of Change, Testing, and Related Issues.
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.


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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 19, 2026

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) View Branch
Fly.io Electric (Fly.io) Failed to deploy
Vercel API (Vercel) Open Preview
Vercel Web (Vercel) Open Preview
Vercel Marketing (Vercel) Open Preview
Vercel Admin (Vercel) Open Preview
Vercel Docs (Vercel) Open Preview

Preview updates automatically with new commits

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