mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
dialect/sql/schema: allow ariga.io/atlas schema diff to be extended (#3514)
By not relying on the SchemaDiff signature, we allow the schema.Differ to be extended without introducing breaking changes to ent
This commit is contained in:
@@ -1153,7 +1153,9 @@ func (r *diffDriver) RealmDiff(_, _ *schema.Realm) ([]schema.Change, error) {
|
||||
|
||||
// SchemaDiff creates the diff between two schemas, but includes "diff hooks".
|
||||
func (r *diffDriver) SchemaDiff(from, to *schema.Schema) ([]schema.Change, error) {
|
||||
var d Differ = DiffFunc(r.Driver.SchemaDiff)
|
||||
var d Differ = DiffFunc(func(current, desired *schema.Schema) ([]schema.Change, error) {
|
||||
return r.Driver.SchemaDiff(current, desired)
|
||||
})
|
||||
for i := len(r.hooks) - 1; i >= 0; i-- {
|
||||
d = r.hooks[i](d)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user