gorm
gorm copied to clipboard
Dry run auto migrate
- [x] Do only one thing
- [x] Non breaking API changes
- [x] Tested
What did this pull request do?
Add a flag Config.DryRunMigration
to let AutoMigrate()
return an error before changing the schema.
User Case Description
See https://github.com/go-gorm/gorm/issues/5635.
Notice
it requires https://github.com/go-gorm/gorm/pull/5644 (migrate check constraints without relationship constraints) and https://github.com/go-gorm/gorm/pull/5620 (postgres) to run tests succeed
Rebased with fix https://github.com/go-gorm/gorm/pull/5620.
Rebased with the latest commit.
In favor of https://github.com/go-gorm/gorm/pull/5689