Skip to content

fix(migration): enhance migration logic to handle existing tables and…#24

Merged
AxiosLeo merged 2 commits intomainfrom
fix/migration-duplicate
Feb 23, 2026
Merged

fix(migration): enhance migration logic to handle existing tables and…#24
AxiosLeo merged 2 commits intomainfrom
fix/migration-duplicate

Conversation

@AxiosLeo
Copy link
Owner

@AxiosLeo AxiosLeo commented Feb 23, 2026

… prevent duplicate migrations


Note

Medium Risk
Changes migration execution control flow based on persisted state; incorrect detection or partial state could cause expected migrations to be skipped or rolled back unexpectedly.

Overview
Migration initialization now imports TransactionHandler from ./transaction and, when the migration tracking table already exists, loads existing rows into context.items instead of exiting blindly.

run() uses context.items to skip up migrations that have already been recorded and to skip down migrations that were never applied, reducing duplicate/invalid migration executions and adding clearer console output when the migration table is already present.

Written by Cursor Bugbot for commit 03b0136. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@AxiosLeo AxiosLeo merged commit d4c794f into main Feb 23, 2026
13 checks passed
@AxiosLeo AxiosLeo deleted the fix/migration-duplicate branch February 23, 2026 09:56
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