Skip to content

PostgreSQL types in context based multi-tenancy #538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
xanderio opened this issue Apr 26, 2025 · 0 comments
Open

PostgreSQL types in context based multi-tenancy #538

xanderio opened this issue Apr 26, 2025 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@xanderio
Copy link

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

postgres do 
  custom_statements do
    statement :foo do
      global? true
      up "..."
      down "..."
    end
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: Someday
Development

No branches or pull requests

2 participants