AppRecorder

GitHub Workflow Status GitHub issues License Hex.pm Hex.pm

Record events

Installation

AppRecorder is published on Hex.
The package can be installed by adding app_recorder to your list of dependencies in mix.exs:

def deps do
  [
    {:app_recorder, "~> 0.4"}
  ]
end

After the packages are installed you must create a database migration for each version to add the app_recorder tables to your database:

defmodule AppRecorder.TestRepo.Migrations.CreateAppRecorderTables do
  use Ecto.Migration

  def up do
    AppRecorder.Migrations.V1.up()

    Padlock.Mutexes.Migrations.V1.up()
    AppRecorder.Migrations.Events.V1.up()
    AppRecorder.Migrations.Events.V2.up()

    AppRecorder.Migrations.Requests.V1.up()
    AppRecorder.Migrations.Requests.V2.up()
  end

  def down do
    AppRecorder.Migrations.V1.down()

    Padlock.Mutexes.Migrations.V1.down()
    AppRecorder.Migrations.Events.V1.down()
    AppRecorder.Migrations.Events.V2.down()

    AppRecorder.Migrations.Requests.V1.down()
    AppRecorder.Migrations.Requests.V2.down()
  end
end

This will run all of AppRecorder's versioned migrations for your database. Migrations between versions are idempotent and will never change after a release. As new versions are released you may need to run additional migrations.

Now, run the migration to create the table:

mix ecto.migrate