# `EctoPGMQ.Migrations`
[🔗](https://github.com/gdwoolbert3/ecto_pgmq/blob/main/lib/ecto_pgmq/migrations.ex#L1)

The entrypoint for managing PGMQ-related `Ecto.Migration` implementations.

# `create_queue`

```elixir
@spec create_queue(EctoPGMQ.Queue.name(), EctoPGMQ.queue_create_attributes(), [
  EctoPGMQ.PGMQ.query_opt()
]) :: :ok
```

Creates a queue with the given name in an `Ecto.Migration`.

For more information, see `EctoPGMQ.create_queue/3`.

## Examples

```elixir
create_queue("my_queue")
```

# `drop_queue`

```elixir
@spec drop_queue(
  EctoPGMQ.Queue.name(),
  keyword()
) :: :ok
```

Drops the given queue in an `Ecto.Migration`.

For more information, see `EctoPGMQ.drop_queue/3`.

## Examples

```elixir
drop_queue("my_queue")
```

# `update_queue`

```elixir
@spec update_queue(EctoPGMQ.Queue.name(), EctoPGMQ.queue_update_attributes(), [
  EctoPGMQ.PGMQ.query_opt()
]) :: :ok
```

Updates the given queue in an `Ecto.Migration`.

For more information, see `EctoPGMQ.update_queue/4`.

## Examples

```elixir
update_queue("my_queue", %{notifications: 1_000})
```

# `create_extension`

```elixir
@spec create_extension() :: :ok
```

Creates the PGMQ extension in an `Ecto.Migration`.

For more information, see [PGMQ Installation](#pgmq-installation).

## Examples

```elixir
create_extension()
```

# `drop_extension`

```elixir
@spec drop_extension() :: :ok
```

Drops the PGMQ extension in an `Ecto.Migration`.

For more information, see [PGMQ Installation](#pgmq-installation).

## Examples

```elixir
drop_extension()
```

# `update_extension`

Updates the PGMQ extension to the default version in an `Ecto.Migration`.

For more information, see [PGMQ Installation](#pgmq-installation).

## Examples

```elixir
update_extension()
```

# `update_extension`

```elixir
@spec update_extension(Version.version()) :: :ok
```

Updates the PGMQ extension in an `Ecto.Migration`.

For more information, see [PGMQ Installation](#pgmq-installation).

## Examples

```elixir
update_extension("1.9.0")

update_extension(Version.parse!("1.9.0"))
```

# `drop_schema`

```elixir
@spec drop_schema() :: :ok
```

Drops the PGMQ schema in an `Ecto.Migration`.

> #### Warning {: .warning}
>
> This function should **NOT** be used if PGMQ is installed as an extension.

For more information, see [PGMQ Installation](#pgmq-installation).

## Examples

```elixir
drop_schema()
```

# `import_schema`

```elixir
@spec import_schema(Path.t()) :: :ok
```

Imports a PGMQ schema file in an `Ecto.Migration`.

> #### Warning {: .warning}
>
> This function leverages the same adapter callback as
> [`mix ecto.load`](https://hexdocs.pm/ecto_sql/Mix.Tasks.Ecto.Load.html) and
> therefore, requires that the `psql` shell utility is available.

For more information, see [PGMQ Installation](#pgmq-installation).

## Examples

```elixir
path =
  :my_app
  |> :code.priv_dir()
  |> Path.join("repo/extensions/pgmq--1.9.0.sql")

import_schema(path)
```

---

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