     assert PaperTrail.get_current_model(first_version) == person
   end
   # query meta data!!
+
+  # Functions
+  defp reset_all_data() do
+    @repo.delete_all(Person)
+    @repo.delete_all(Company)
+    @repo.delete_all(Version)
+
+    Person
+    |> MultiTenant.add_prefix_to_query()
+    |> @repo.delete_all()
+
+    Company
+    |> MultiTenant.add_prefix_to_query()
+    |> @repo.delete_all()
+
+    Version
+    |> MultiTenant.add_prefix_to_query()
+    |> @repo.delete_all()
+  end
 end

      company_id: another_company.id
    }) |> PaperTrail.update(set_by: "user:1", meta: %{linkname: "izelnakri"})

    :ok
  end

  test "get_version gives us the right version" do
    last_person = last(Person, :id) |> @repo.one
    target_version = last(Version, :id) |> @repo.one

    assert PaperTrail.get_version(last_person) == target_version
    assert PaperTrail.get_version(Person, last_person.id) == target_version
  end

  test "get_versions gives us the right versions" do
    last_person = last(Person, :id) |> @repo.one
    target_versions = @repo.all(
      from version in Version,
      where: version.item_type == "SimplePerson" and version.item_id == ^last_person.id
    )

    assert PaperTrail.get_versions(last_person) == target_versions
    assert PaperTrail.get_versions(Person, last_person.id) == target_versions
  end

  test "get_current_model/1 gives us the current record of a version" do

  alias PaperTrail.Version
  alias SimpleCompany, as: Company
  alias SimplePerson, as: Person
  alias PaperTrailTest.MultiTenantHelper, as: MultiTenant

  import Ecto.Query

  @repo PaperTrail.RepoClient.repo

  setup_all do
    MultiTenant.setup_tenant(@repo)
    reset_all_data()

    Company.changeset(%Company{}, %{
      name: "Acme LLC", is_active: true, city: "Greenwich"
