Skip to content
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

Support for multitenant schemas in Active Record extension #146

Open
joshuap opened this issue Oct 20, 2021 · 0 comments
Open

Support for multitenant schemas in Active Record extension #146

joshuap opened this issue Oct 20, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@joshuap
Copy link
Member

joshuap commented Oct 20, 2021

This is an issue that was originally reported in #145 and I want to document it here for future users. PRs are welcome.

TLDR: if you're getting a similar error (see below), check to see if you're using a gem that is using custom schemas, such as the apartment gem. Heya does not currently support schemas.

Here's the error message that you may encounter if you're running into this issue:

$ rails heya:scheduler 
rails aborted!
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "heya_steps" does not exist
LINE 1: ...M "public"."heya_campaign_memberships" INNER JOIN "heya_step...
                                                             ^
Caused by:
PG::UndefinedTable: ERROR:  relation "heya_steps" does not exist
LINE 1: ...M "public"."heya_campaign_memberships" INNER JOIN "heya_step...
                                                             ^
Tasks: TOP => heya:scheduler
(See full trace by running task with --trace)

Here's one possible explanation:

It could be that I'm using the Apartment gem for multi-tenant schemas, I think the two are conflicting - the "public"."heya_campaign_memberships" table in the public schema, but the "heya_steps" table is being defined without a schema. I think this is it anyway.

@joshuap joshuap added enhancement New feature or request help wanted Extra attention is needed labels Oct 20, 2021
@joshuap joshuap changed the title Support for multi-tenant schemas in Active Record extension Support for multitenant schemas in Active Record extension Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant