     Application.put_env(:paper_trail, :repo, PaperTrail.Repo)
     Code.eval_file("lib/paper_trail.ex")
     Code.eval_file("lib/version.ex")
+    MultiTenant.setup_tenant(@repo)
     :ok
   end
 
   setup do
     @repo.delete_all(Version)
+    Version
+    |> MultiTenant.add_prefix_to_query()
+    |> @repo.delete_all()
     on_exit fn ->
       @repo.delete_all(Version)
+      Version
+      |> MultiTenant.add_prefix_to_query()
+      |> @repo.delete_all()
     end
     :ok
   end

      }
    ], returning: true) |> elem(1)
  end

  def serialize(nil), do: nil
  def serialize(resource) do

    }
  end

  # Multi tenant tests
  test "[multi tenant] count works" do
    versions = add_three_versions_multi()
    Version.count(prefix: MultiTenant.tenant()) == length(versions)
  end

  test "[multi tenant] first works" do
    versions = add_three_versions_multi()
    Version.first(prefix: MultiTenant.tenant()) |> serialize == @valid_attrs
  end

  test "[multi tenant] last works" do
    versions = add_three_versions_multi()
    Version.last(prefix: MultiTenant.tenant()) |> serialize != %{
      event: "insert",
      item_type: "Person",
      item_id: 3,
      item_changes: %{first_name: "Yukihiro", last_name: "Matsumoto"},
      origin: "test",
      inserted_at: DateTime.from_naive!(~N[1965-04-14 01:00:00.000], "Etc/UTC")
    }
  end

  def add_three_versions do
    @repo.insert_all(Version, [
      @valid_attrs,
