ash-project / ash-project/ash_postgres

PostgreSQL types in context based multi-tenancy

Open
#538 1 comment 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Elixir
Stars
189
Forks
168
Avg merge
13h 1m
Merged PRs (30d)
22

Description

**Is your feature request related to a problem? Please describe.**

When creating a PostgreSQL custom enum type via `CREATE TYPE foo AS ENUM ('bar', 'foobar')` inside the `custom_statements` block while utilising context based multi-tenancy, the statement is placed into the tenant migration. This will fail to execute this statement as soon as a second tenant is created. Types in this context are global for the entire database.

**Describe the solution you'd like**

A configuration option that a statement should be place in the non-tenant migration set.

**Describe alternatives you've considered**

Currently, the only workaround is manual intervention.

**Express the feature either with a change to resource syntax, or with a change to the resource interface**

```elixir
postgres do
custom_statements do
statement :foo do
global? true
up "..."
down "..."
end
end
end
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.