Skip to content

Hardcode sqlite migration key-drop fix#4458

Merged
ildyria merged 1 commit into
masterfrom
fix-sqlite
Jun 24, 2026
Merged

Hardcode sqlite migration key-drop fix#4458
ildyria merged 1 commit into
masterfrom
fix-sqlite

Conversation

@ildyria

@ildyria ildyria commented Jun 24, 2026

Copy link
Copy Markdown
Member

Fixes #4457
Fixes #4137

Summary by CodeRabbit

  • Bug Fixes
    • Improved database migration reliability on SQLite by handling a database-generated index before removing an old column.
    • Prevents migration failures when the index is missing or when column and index drop order would otherwise cause errors.

@ildyria ildyria requested a review from a team as a code owner June 24, 2026 09:20
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

A SQLite-specific try/catch block is added to the up() method of the 2026_02_22_090000_drop_old_album_id_from_photos migration. It issues a raw DROP INDEX idx_876e0d91137abcf statement before the existing column/index drop logic, swallowing any exceptions to prevent SQLite errors from index ordering conflicts.

Changes

SQLite Migration Fix

Layer / File(s) Summary
SQLite index drop guard in up()
database/migrations/2026_02_22_090000_drop_old_album_id_from_photos.php
Adds a try/catch block that executes a raw DROP INDEX idx_876e0d91137abcf on SQLite before dropping the old_album_id column; exceptions are swallowed so the migration proceeds regardless of whether the index exists.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

A rabbit hops past columns old,
An index lurked, so I was told.
DROP INDEX — catch! — we carry on,
SQLite's grumble quietly gone.
🐇✨ The migration runs at dawn!

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c7e73a8e-bea4-460f-832c-7c4b071d12c3

📥 Commits

Reviewing files that changed from the base of the PR and between 4df83b4 and 811d458.

📒 Files selected for processing (1)
  • database/migrations/2026_02_22_090000_drop_old_album_id_from_photos.php

@ildyria ildyria changed the title Hardcode sqlite migration key drop fix Hardcode sqlite migration key-drop fix Jun 24, 2026
@ildyria ildyria merged commit 6149220 into master Jun 24, 2026
48 checks passed
@ildyria ildyria deleted the fix-sqlite branch June 24, 2026 10:10
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