mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
dialect/sql/schema: allow planning with indentation (#3363)
This commit is contained in:
@@ -33,11 +33,12 @@ type Atlas struct {
|
||||
withFixture bool // deprecated: with fks rename fixture
|
||||
sum bool // deprecated: sum file generation will be required
|
||||
|
||||
errNoPlan bool // no plan error enabled
|
||||
universalID bool // global unique ids
|
||||
dropColumns bool // drop deleted columns
|
||||
dropIndexes bool // drop deleted indexes
|
||||
withForeignKeys bool // with foreign keys
|
||||
indent string // plan indentation
|
||||
errNoPlan bool // no plan error enabled
|
||||
universalID bool // global unique ids
|
||||
dropColumns bool // drop deleted columns
|
||||
dropIndexes bool // drop deleted indexes
|
||||
withForeignKeys bool // with foreign keys
|
||||
mode Mode
|
||||
hooks []Hook // hooks to apply before creation
|
||||
diffHooks []DiffHook // diff hooks to run when diffing current and desired
|
||||
@@ -804,6 +805,11 @@ func (a *Atlas) diff(ctx context.Context, name string, current, desired *schema.
|
||||
filtered = append(filtered, c)
|
||||
}
|
||||
}
|
||||
if a.indent != "" {
|
||||
opts = append(opts, func(opts *migrate.PlanOptions) {
|
||||
opts.Indent = a.indent
|
||||
})
|
||||
}
|
||||
plan, err := a.atDriver.PlanChanges(ctx, name, filtered, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user