Chronicle. Ecto. Migration
(chronicle v0.1.2)
Copy Markdown
Reusable Ecto migration for the default audit store.
Create a migration in the host application:
defmodule MyApp.Repo.Migrations.CreateAuditTables do
use Ecto.Migration
def up, do: Chronicle.Ecto.Migration.up()
def down, do: Chronicle.Ecto.Migration.down()
endThe functions accept :prefix, :events_table, :ledger_heads_table,
and :ledger_entries_table.
Groups and events share one table. A group root is a row with
kind = "group" carrying the unit's type, outcome, timing, and child
count; its children are rows with kind = "event" whose group_id points
back at it.