Skip to content

Commit 30223a1

Browse files
committed
fix: raise when all_tenants/0 default impl is called
1 parent 20a548d commit 30223a1

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/repo.ex

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,19 @@ defmodule AshPostgres.Repo do
4545
def installed_extensions, do: []
4646
def tenant_migrations_path, do: nil
4747
def migrations_path, do: nil
48-
def all_tenants, do: []
48+
49+
def all_tenants do
50+
raise """
51+
`#{inspect(__MODULE__)}.all_tenants/0` was called, but was not defined. In order to migrate tenants, you must define this function.
52+
For example, you might say:
53+
54+
def all_tenants do
55+
for org <- MyApp.Accounts.all_organizations!() do
56+
org.schema
57+
end
58+
end
59+
"""
60+
end
4961

5062
def init(_, config) do
5163
new_config =

0 commit comments

Comments
 (0)