mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 21:43:12 +12:00
37cc01957d
* WIP * chore: fix mix.lock merge issues * improvement: upgrade to 3.0 * chore: remove `repo.to_tenant` * chore: continue removal of unnecessary helper * chore: use `Ash.ToTenant`
26 lines
629 B
Elixir
26 lines
629 B
Elixir
defmodule AshPostgres.TestRepo do
|
|
@moduledoc false
|
|
use AshPostgres.Repo,
|
|
otp_app: :ash_postgres
|
|
|
|
def on_transaction_begin(data) do
|
|
send(self(), data)
|
|
end
|
|
|
|
def pg_version do
|
|
Version.parse!(System.get_env("PG_VERSION") || "16.0.0")
|
|
end
|
|
|
|
def installed_extensions do
|
|
["ash-functions", "uuid-ossp", "pg_trgm", "citext", AshPostgres.TestCustomExtension] --
|
|
Application.get_env(:ash_postgres, :no_extensions, [])
|
|
end
|
|
|
|
def all_tenants do
|
|
Code.ensure_compiled(AshPostgres.MultitenancyTest.Org)
|
|
|
|
AshPostgres.MultitenancyTest.Org
|
|
|> Ash.read!()
|
|
|> Enum.map(&"org_#{&1.id}")
|
|
end
|
|
end
|