Fleet.Migration (fleet v0.1.0)

Copy Markdown View Source

Ecto migration helper to install and uninstall the PgQue database schema and functions.

Example

defmodule MyApp.Repo.Migrations.AddFleet do
  use Ecto.Migration

  def up do
    Fleet.Migration.up()
  end

  def down do
    Fleet.Migration.down()
  end
end

Summary

Functions

Creates a new PgQue queue.

Uninstalls the PgQue schema and associated functions.

Installs the PgQue schema, tables, and stored procedures. Accepts optional :queues keyword argument specifying queue names to create.

Functions

create_queue(queue_name)

@spec create_queue(String.t() | atom()) :: :ok

Creates a new PgQue queue.

down()

@spec down() :: :ok

Uninstalls the PgQue schema and associated functions.

up(opts \\ [])

@spec up(keyword()) :: :ok

Installs the PgQue schema, tables, and stored procedures. Accepts optional :queues keyword argument specifying queue names to create.