All threads / Multi Tenant based database can connect into another database like multi-db connection?
Ask A Question

Notifications

You’re not receiving notifications from this thread.

Multi Tenant based database can connect into another database like multi-db connection?

vinay sharma asked in Databases

I've been working on one project that has already implemented a multi-tenant database setup using the apartment gem. and now I need to connect this multi-tenant database to my other project. I've connected the database successfully, but I've only got excluded model information, so I'm not able to switch the tenant subdomain. It shows this error.

ex : subdomain name = 'iso'

Apartment::TenantNotFound (Could not set search path to schemas, they may be invalid: "iso" "iso".)
Original error: ActiveRecord::StatementInvalid: Could not find schema iso

So how do I add those schemas to my other project? Is it possible or not? If anyone has an idea. Please share it. 

Thanks.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 69,840+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.