View Source Beacon.Migration (Beacon v0.1.0-rc.0)

Functions which can be called in an Ecto migration for Beacon installation and upgrades.

Usage

To install Beacon, you'll need to generate an Ecto.Migration that wraps calls to Beacon.Migration:

mix ecto.gen.migration create_beacon_tables

Open the generated migration in your editor and either call or delegate to up/0 and down/0:

defmodule MyApp.Repo.Migrations.CreateBeaconTables do
  use Ecto.Migration
  def up, do: Beacon.Migration.up()
  def down, do: Beacon.Migration.down()
end

Then, run the migrations for your app to create the necessary Beacon tables in your database:

mix ecto.migrate

Note that up/0 will always execute all migration steps from the initial version to the latest version, and those migration are idempotent.

Check out the your first site guide for a full example.

Summary

Functions

Run the down changes for all migrations between the initial version and the current version.

Run the up changes for all migrations between the initial version and the current version.

Functions

Run the down changes for all migrations between the initial version and the current version.

Run the up changes for all migrations between the initial version and the current version.