Versioned.Migration (Versioned v0.2.0) View Source

Allows creating tables for versioned schemas.

Example

defmodule MyApp.Repo.Migrations.CreateCar do
  use Versioned.Migration

  def change do
    create_versioned_table(:cars) do
      add :name, :string
    end
  end
end

Link to this section Summary

Functions

Add a new column to both the main table and the versions table.

Create a table whose data is versioned by also creating a secondary table with the immutable, append-only history.

Link to this section Functions

Link to this macro

add_versioned_column(table_name, name, type, opts \\ [])

View Source (macro)

Add a new column to both the main table and the versions table.

Link to this macro

create_versioned_table(name_plural, opts \\ [], list)

View Source (macro)

Create a table whose data is versioned by also creating a secondary table with the immutable, append-only history.