Skip to content

Commit

Permalink
Make it compatible with mariadb (#71)
Browse files Browse the repository at this point in the history
* Do not start postgrex application by default
* Make read_after_writes for origin optional
  • Loading branch information
ggpasqualino committed Feb 27, 2020
1 parent bb6bab9 commit 5855d10
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/version.ex
Expand Up @@ -14,7 +14,11 @@ defmodule PaperTrail.Version do
field(:item_id, Application.get_env(:paper_trail, :item_type, :integer))
field(:item_changes, :map)
field(:originator_id, Application.get_env(:paper_trail, :originator_type, :integer))
field(:origin, :string, read_after_writes: true)

field(:origin, :string,
read_after_writes: Application.get_env(:paper_trail, :origin_read_after_writes, true)
)

field(:meta, :map)

if PaperTrail.RepoClient.originator() do
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Expand Up @@ -20,7 +20,7 @@ defmodule PaperTrail.Mixfile do
# Type "mix help compile.app" for more information
def application do
[
applications: [:logger, :postgrex, :ecto, :runtime_tools]
applications: [:logger, :ecto, :runtime_tools]
]
end

Expand Down
2 changes: 2 additions & 0 deletions test/test_helper.exs
@@ -1,3 +1,5 @@
Application.start(:postgrex)

Mix.Task.run("ecto.drop")
Mix.Task.run("ecto.create")
Mix.Task.run("ecto.migrate")
Expand Down

0 comments on commit 5855d10

Please sign in to comment.