README.md
      
      
        
        # AppRecorder
[](https://github.com/annatel/app_recorder/actions) [](https://github.com/annatel/app_recorder/issues) [](http://opensource.org/licenses/MIT) [](https://hex.pm/packages/app_recorder) [](https://hex.pm/packages/app_recorder)
Record events
## Installation
AppRecorder is published on [Hex](https://hex.pm/packages/app_recorder).  
The package can be installed by adding `app_recorder` to your list of dependencies in `mix.exs`:
```elixir
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:
```elixir
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:
```sh
mix ecto.migrate
```