Skip to content

Warn when --fake marks multiple migrations as run#1400

Open
AnayGarodia wants to merge 1 commit into
piccolo-orm:masterfrom
AnayGarodia:warn-fake-multiple-migrations
Open

Warn when --fake marks multiple migrations as run#1400
AnayGarodia wants to merge 1 commit into
piccolo-orm:masterfrom
AnayGarodia:warn-fake-multiple-migrations

Conversation

@AnayGarodia

Copy link
Copy Markdown

Closes #1255

piccolo migrations forwards --fake marks pending migrations as run without applying them. When several migrations are pending, running it with --fake silently fakes all of them, which is an easy way to lose track of which schema changes were actually applied.

As agreed in #1255, this adds a warning when --fake will mark more than one migration as run, printed right after the "Running N migrations" line and before they are faked. A single faked migration is unchanged.

The regression test (test_forwards_fake_multiple_warns) fakes the music app's migrations with fake=True and asserts the warning is printed; it fails on master and passes with this change. The rest of the forwards/backwards suite still passes.

Copilot AI review requested due to automatic review settings July 8, 2026 18:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

applying migration forward <module> --fake should not fake all migrations

2 participants