mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
dialect/sql/schema: allow running migration concurrently without copying the tables (#4475)
This commit is contained in:
@@ -1078,6 +1078,7 @@ func (a *Atlas) aIndexes(et *Table, at *schema.Table) error {
|
||||
// are linked to their indexes, and PKs columns are defined.
|
||||
func (a *Atlas) setupTables(tables []*Table) {
|
||||
for _, t := range tables {
|
||||
t.mu.Lock()
|
||||
if t.columns == nil {
|
||||
t.columns = make(map[string]*Column, len(t.Columns))
|
||||
}
|
||||
@@ -1101,6 +1102,7 @@ func (a *Atlas) setupTables(tables []*Table) {
|
||||
fk.Columns[i].foreign = fk
|
||||
}
|
||||
}
|
||||
t.mu.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user