Configure to use structure.sql instead of schema.rb in rails
config.active_record.schema_format = :sql
run rake db:migrate
Create some tenant
Apartment::Tenant.create('my_tenant')
Expected behavior
~In file structure.sql must have only public schema~
In file structure.sql must have only table, without schema.
Actual behavior
In file structure.sql has public schema and other
Example:
CREATE TABLE public.ar_internal_metadata (
key character varying NOT NULL,
value character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
CREATE TABLE my_tenant.ar_internal_metadata (
key character varying NOT NULL,
value character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
System configuration
Database: PostgreSQL 9.6
Apartment version: 2.2.0
Apartment config (in config/initializers/apartment.rb or so):
Steps to reproduce
Configure to use
structure.sql
instead ofschema.rb
in railsrun
rake db:migrate
Create some tenant
Expected behavior
~In file
structure.sql
must have only public schema~ In filestructure.sql
must have only table, without schema.Actual behavior
In file
structure.sql
has public schema and otherExample:
System configuration
Database: PostgreSQL 9.6
Apartment version: 2.2.0
Apartment config (in
config/initializers/apartment.rb
or so):use_schemas
:false
Rails (or ActiveRecord) version: 5.1.6
Ruby version: 2.5.1