gorm icon indicating copy to clipboard operation
gorm copied to clipboard

Dry run auto migrate

Open googollee opened this issue 2 years ago • 2 comments

  • [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

googollee avatar Aug 25 '22 14:08 googollee

Rebased with fix https://github.com/go-gorm/gorm/pull/5620.

googollee avatar Aug 25 '22 14:08 googollee

Rebased with the latest commit.

googollee avatar Sep 14 '22 21:09 googollee

In favor of https://github.com/go-gorm/gorm/pull/5689

jinzhu avatar Oct 20 '22 06:10 jinzhu