diff options
Diffstat (limited to 'vendor/github.com/uptrace/bun/schema/tables.go')
-rw-r--r-- | vendor/github.com/uptrace/bun/schema/tables.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vendor/github.com/uptrace/bun/schema/tables.go b/vendor/github.com/uptrace/bun/schema/tables.go index 4be856b34..b6215a14a 100644 --- a/vendor/github.com/uptrace/bun/schema/tables.go +++ b/vendor/github.com/uptrace/bun/schema/tables.go @@ -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 { |