Skip to content

Commit

Permalink
fix: init table with dialect once
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Oct 29, 2021
1 parent 9674812 commit 9a1ce1e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions schema/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ func (t *Tables) table(typ reflect.Type, allowInProgress bool) *Table {
return table
}

if inProgress.init2() {
t.mu.Lock()
delete(t.inProgress, typ)
t.tables.Store(typ, table)
t.mu.Unlock()
if !inProgress.init2() {
return table
}

t.mu.Lock()
delete(t.inProgress, typ)
t.tables.Store(typ, table)
t.mu.Unlock()

t.dialect.OnTable(table)

for _, field := range table.FieldMap {
Expand Down

0 comments on commit 9a1ce1e

Please sign in to comment.