Skip to content

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

Merged
dantownsend merged 3 commits into
piccolo-orm:masterfrom
AnayGarodia:warn-fake-multiple-migrations
Jul 20, 2026
Merged

Warn when --fake marks multiple migrations as run#1400
dantownsend merged 3 commits into
piccolo-orm:masterfrom
AnayGarodia:warn-fake-multiple-migrations

Conversation

@AnayGarodia

Copy link
Copy Markdown
Contributor

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.

@dantownsend

Copy link
Copy Markdown
Member

Thanks for this. I made a tweak - so we use input to ask the user if they want to proceed.

@dantownsend
dantownsend merged commit e140ab6 into piccolo-orm:master Jul 20, 2026
46 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.

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

3 participants