ash_postgres/test/support/test_repo.ex

27 lines
616 B
Elixir
Raw Normal View History

2020-09-03 20:18:11 +12:00
defmodule AshPostgres.TestRepo do
@moduledoc false
use AshPostgres.Repo,
otp_app: :ash_postgres
def on_transaction_begin(data) do
send(self(), data)
end
def installed_extensions do
["ash-functions", "uuid-ossp", "pg_trgm", "citext", AshPostgres.TestCustomExtension] --
2022-09-21 15:00:29 +12:00
Application.get_env(:ash_postgres, :no_extensions, [])
end
2020-10-29 15:26:45 +13:00
def min_pg_version do
%Version{major: 16, minor: 0, patch: 0}
end
2020-10-29 15:26:45 +13:00
def all_tenants do
Code.ensure_compiled(AshPostgres.MultitenancyTest.Org)
AshPostgres.MultitenancyTest.Org
|> Ash.read!()
2020-10-29 15:26:45 +13:00
|> Enum.map(&"org_#{&1.id}")
end
2020-09-03 20:18:11 +12:00
end