dialect/sql/schema: allow configuring Atlas to return ErrNoPlan (#3322)

This commit is contained in:
Ariel Mashraki
2023-02-16 21:56:51 +02:00
committed by GitHub
parent 8a31204259
commit bd6f26aa7c
3 changed files with 24 additions and 5 deletions

View File

@@ -41,6 +41,14 @@ func WithGlobalUniqueID(b bool) MigrateOption {
}
}
// WithErrNoPlan sets Atlas to returns a migrate.ErrNoPlan in case
// the migration plan is empty. Defaults to false.
func WithErrNoPlan(b bool) MigrateOption {
return func(a *Atlas) {
a.errNoPlan = b
}
}
// WithDropColumn sets the columns dropping option to the migration.
// Defaults to false.
func WithDropColumn(b bool) MigrateOption {