mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 13:33:50 +12:00
docs: update docs
This commit is contained in:
parent
985e928340
commit
ec08e0131f
1 changed files with 8 additions and 2 deletions
|
@ -19,10 +19,16 @@ defmodule MyApp.Organization do
|
||||||
use Ash.Resource,
|
use Ash.Resource,
|
||||||
...
|
...
|
||||||
|
|
||||||
manage_tenant do
|
postgres do
|
||||||
template ["org_", :id]
|
...
|
||||||
|
|
||||||
|
manage_tenant do
|
||||||
|
template ["org_", :id]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
With this configuration, if you create an organization, it will create a corresponding schema, e.g. `org_10` in the database. Then it will run your tenant migrations on that schema. To override the tenant_migrations path, implement the `c:AshPostgres.Repo.tenant_migrations_path/0` callback.
|
With this configuration, if you create an organization, it will create a corresponding schema, e.g. `org_10` in the database. Then it will run your tenant migrations on that schema. To override the tenant_migrations path, implement the `c:AshPostgres.Repo.tenant_migrations_path/0` callback.
|
||||||
|
|
||||||
|
Notice that `manage_tenant` is nested inside the `postgres` block. This is because the method of managing tenants is specific to postgres, and if another data layer supported multitenancy they may or may not support managing tenants in the same way.
|
Loading…
Reference in a new issue