{"id":20816384,"url":"https://github.com/nebo15/ecto_trail","last_synced_at":"2025-05-10T23:08:54.236Z","repository":{"id":20123026,"uuid":"88860085","full_name":"Nebo15/ecto_trail","owner":"Nebo15","description":"EctoTrail allows to store Ecto changeset changes in a separate audit_log table.","archived":false,"fork":false,"pushed_at":"2023-11-22T16:29:22.000Z","size":51,"stargazers_count":54,"open_issues_count":4,"forks_count":5,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-10T23:08:47.663Z","etag":null,"topics":["ecto","elixir","elixir-lang","hex","package"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/ecto_trail","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nebo15.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-20T11:53:49.000Z","updated_at":"2023-10-25T23:04:48.000Z","dependencies_parsed_at":"2024-11-18T01:15:17.434Z","dependency_job_id":null,"html_url":"https://github.com/Nebo15/ecto_trail","commit_stats":{"total_commits":27,"total_committers":8,"mean_commits":3.375,"dds":0.6296296296296297,"last_synced_commit":"efe5ec64d76b6290d30d944e2a4cfe65a50cefe3"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nebo15%2Fecto_trail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nebo15%2Fecto_trail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nebo15%2Fecto_trail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nebo15%2Fecto_trail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nebo15","download_url":"https://codeload.github.com/Nebo15/ecto_trail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253492757,"owners_count":21916974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecto","elixir","elixir-lang","hex","package"],"created_at":"2024-11-17T21:33:32.272Z","updated_at":"2025-05-10T23:08:54.214Z","avatar_url":"https://github.com/Nebo15.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EctoTrail\n[![Hex.pm Downloads](https://img.shields.io/hexpm/dw/ecto_trail.svg?maxAge=3600)](https://hex.pm/packages/ecto_trail) [![Latest Version](https://img.shields.io/hexpm/v/ecto_trail.svg?maxAge=3600)](https://hex.pm/packages/ecto_trail) [![License](https://img.shields.io/hexpm/l/ecto_trail.svg?maxAge=3600)](https://hex.pm/packages/ecto_trail) [![Build Status](https://travis-ci.org/Nebo15/ecto_trail.svg?branch=master)](https://travis-ci.org/Nebo15/ecto_trail) [![Coverage Status](https://coveralls.io/repos/github/Nebo15/ecto_trail/badge.svg?branch=master)](https://coveralls.io/github/Nebo15/ecto_trail?branch=master) [![Ebert](https://ebertapp.io/github/Nebo15/ecto_trail.svg)](https://ebertapp.io/github/Nebo15/ecto_trail)\n\nEctoTrail allows to store changeset changes into a separate `audit_log` table.\n\n## Installation and usage\n\n1. Add `ecto_trail` to your list of dependencies in `mix.exs`:\n\n  ```elixir\n  def deps do\n    [{:ecto_trail, \"~\u003e 0.4.0\"}]\n  end\n  ```\n\n2. Ensure `ecto_trail` is started before your application:\n\n  ```elixir\n  def application do\n    [extra_applications: [:ecto_trail]]\n  end\n  ```\n\n3. Add a migration that creates `audit_log` table to `priv/repo/migrations` folder:\n\n  ```elixir\n  defmodule EctoTrail.TestRepo.Migrations.CreateAuditLogTable do\n    @moduledoc false\n    use Ecto.Migration\n\n    def change do\n      create table(:audit_log, primary_key: false) do\n        add :id, :uuid, primary_key: true\n        add :actor_id, :string, null: false\n        add :resource, :string, null: false\n        add :resource_id, :string, null: false\n        add :changeset, :map, null: false\n\n        timestamps([type: :utc_datetime, updated_at: false])\n      end\n    end\n  end\n  ```\n\n4. Use `EctoTrail` in your repo:\n\n  ```elixir\n  defmodule MyApp.Repo do\n    use Ecto.Repo, otp_app: :my_app\n    use EctoTrail\n  end\n  ```\n\n5. Configure table name which is used to store audit log (in `config.ex`):\n\n  ```elixir\n  config :ecto_trail, table_name: \"audit_log\"\n  ```\n\n6. Use logging functions instead of defaults. See `EctoTrail` module docs.\n\n## Docs\n\nThe docs can be found at [https://hexdocs.pm/ecto_trail](https://hexdocs.pm/ecto_trail).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebo15%2Fecto_trail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnebo15%2Fecto_trail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebo15%2Fecto_trail/lists"}