Closed vinaysharma4362 closed 1 year ago
The error message means that the postgresql database you are connected to does not have a schema named "iso". To confirm this, use psql
to open a connection to your database from the command line and issue the "\dn" command tpo see a list of schemas.
Using apartment, to create a new tenant. For example, in a rails console, execute Apartment::Tenant.create "iso"
.
The error message means that the postgresql database you are connected to does not have a schema named "iso". To confirm this, use
psql
to open a connection to your database from the command line and issue the "\dn" command tpo see a list of schemas.Using apartment, to create a new tenant. For example, in a rails console, execute
Apartment::Tenant.create "iso"
.
@troya2 thanks for the response, For my project this scenario will not work, because I've to access this tenant-based project into another project. and if I've recreate each and every schema files into another project this cause too much hurdle for the database.
Currently I'm using API based approach to safely perform CRUD operations.
Thanks
I need to setup multi db environment but in our existing database has multiple schemas and i'm not able to perform Apartment::Tenant.switch('subdomain') command
Error
ex: subdomain is
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
Database: (PostgreSQL)
Apartment version: 0.24.3
Apartment config (in
config/initializers/apartment.rb
or so):use_schemas
:true
Rails (or ActiveRecord) version: 6.1.4
Ruby version: 3.0.0