MCPcopy Create free account
hub / github.com/adlio/schema / Unlock

Method Unlock

postgres.go:31–36  ·  view source on GitHub ↗

Unlock implements the Locker interface to release the global lock after the migrations are run.

(ctx context.Context, tx Queryer, tableName string)

Source from the content-addressed store, hash-verified

29// Unlock implements the Locker interface to release the global lock after the
30// migrations are run.
31func (p postgresDialect) Unlock(ctx context.Context, tx Queryer, tableName string) error {
32 lockID := p.advisoryLockID(tableName)
33 query := fmt.Sprintf("SELECT pg_advisory_unlock(%s)", lockID)
34 _, err := tx.ExecContext(ctx, query)
35 return err
36}
37
38// CreateMigrationsTable implements the Dialect interface to create the
39// table which tracks applied migrations. It only creates the table if it

Callers

nothing calls this directly

Calls 2

advisoryLockIDMethod · 0.95
ExecContextMethod · 0.65

Tested by

no test coverage detected