Skip to content

fix(desktop): make migration 11 idempotent by dropping and recreating terminal_persistence column#822

Merged
saddlepaddle merged 2 commits intomainfrom
fix/migration-11-idempotent
Jan 19, 2026
Merged

fix(desktop): make migration 11 idempotent by dropping and recreating terminal_persistence column#822
saddlepaddle merged 2 commits intomainfrom
fix/migration-11-idempotent

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Jan 19, 2026

Fixes migration 11 failing in production by making it idempotent.

Problem

Migration 11 was failing in production, likely because the column was partially added in a previous failed migration attempt.

Solution

Modified the migration to:

  1. Drop the terminal_persistence column if it exists
  2. Then add it fresh

This ensures the migration can run successfully even if previously partially applied.

Testing

  • Canary build created and tested: desktop-canary (v0.0.57-canary.20260119025121)
  • Uses SQLite 3.35.0+ (included in better-sqlite3 v12.5.0) which supports DROP COLUMN

Migration Change

-- Drop the column if it exists (to make migration idempotent for prod fix)
ALTER TABLE `settings` DROP COLUMN `terminal_persistence`;
--> statement-breakpoint
-- Add the column
ALTER TABLE `settings` ADD `terminal_persistence` integer;

Summary by CodeRabbit

  • New Features
    • Added terminal persistence to maintain state between sessions
  • Chores
    • Updated desktop application version to 0.0.57

✏️ 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 bumps the desktop application version from 0.0.56 to 0.0.57 and introduces a database migration that drops and re-adds the terminal_persistence column, along with updating associated migration metadata timestamps and snapshot records.

Changes

Cohort / File(s) Summary
Desktop Version Bump
apps/desktop/package.json
Version incremented from 0.0.56 to 0.0.57
Database Migration
packages/local-db/drizzle/0011_add_terminal_persistence.sql
Adds idempotent migration pattern: unconditionally drops terminal_persistence column before re-adding it as integer; no IF EXISTS condition on drop
Migration Metadata
packages/local-db/drizzle/meta/0011_snapshot.json, packages/local-db/drizzle/meta/_journal.json
Updates snapshot id/prevId rotation and journal timestamp (1768100000000 → 1768790828810) for migration entry idx 11

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A hop and a bump, version anew,
Databases dance with a drop and a brew,
From 0.0.56 to 0.0.57 we climb,
Migrations tick-tock through space and through time!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: making migration 11 idempotent by dropping and recreating the terminal_persistence column.
Description check ✅ Passed The PR description covers the core template sections (problem, solution, testing) with clear context and code examples, though the formal template structure is not strictly followed.
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 Cleanup Complete

The following preview resources have been cleaned up:

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

Thank you for your contribution! 🎉

@saddlepaddle saddlepaddle merged commit 33e1a3d into main Jan 19, 2026
15 of 16 checks passed
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