[pull] main from prisma:main#256
Merged
Merged
Conversation
## Summary Fixes prisma/prisma#29601. `diagnoseMigrationHistory` was matching a migration from the filesystem with any migration table row that had the same name. That included rows marked with `rolled_back_at`, even though those rows are ignored by migrate when they are not null. This changes the history comparison to ignore rolled-back rows when deciding which migrations are already present in the database. A rolled-back migration that still exists on disk is now reported as unapplied, which lets `migrate status` return a non-clean result instead of reporting the schema as up to date. ## Tests ```sh cargo fmt --check git diff --check make dev-sqlite set -a; . ./.test_database_urls/sqlite; set +a CARGO_BUILD_JOBS=2 RUST_TEST_THREADS=1 cargo test -p sql-migration-tests diagnose_migrations_history_reports_rolled_back_migration_as_unapplied -- --test-threads 1 CARGO_BUILD_JOBS=2 RUST_TEST_THREADS=1 cargo test -p sql-migration-tests diagnose_migration_history_tests -- --test-threads 1 CARGO_BUILD_JOBS=2 cargo check -p schema-core -p schema-commands -p sql-migration-tests ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )