# `BullMQ.Backends.Postgres.Migrator`
[🔗](https://github.com/taskforcesh/bullmq/blob/v2.2.3/lib/bullmq/backends/postgres/migrator.ex#L1)

Runs the PostgreSQL backend's schema migrations, mirroring the Node.js
`migrator.ts`.

All objects are created in `schema` (default `bullmq`), the
connection-level namespace that replaces Redis's per-queue key prefix. The
whole run happens inside a single transaction guarded by a transaction-scoped
advisory lock, so concurrent starters across processes migrate exactly once.

# `assert_postgres_version`

```elixir
@spec assert_postgres_version(term(), boolean()) :: :ok
```

Verifies the server meets the minimum major version (raises otherwise) and
warns once when below the recommended version. No-op when `skip_version_check`.

# `default_schema`

The default schema (namespace) the backend lives in.

# `latest_schema_version`

The highest schema version this build knows how to produce.

# `quote_schema_name`

```elixir
@spec quote_schema_name(String.t()) :: String.t()
```

Validates a schema name and returns it double-quoted for safe DDL
interpolation (schema names cannot be bind parameters).

# `run_migrations`

```elixir
@spec run_migrations(term(), String.t(), keyword()) ::
  {:ok, integer()} | {:error, term()}
```

Runs pending migrations for `schema`, returning the resulting schema version.

Runs inside a single Postgrex transaction guarded by a transaction-scoped
advisory lock (serializing concurrent migrators for this schema).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
