I'm developing a multitenant app following this article. The problem is when I run all migrations the first time. In schema.rb
file are only the tables for the public schema but what happend with the others schemas? and how can I create others schemas with different structure to the public
I don't want to use gems.
See the example below
Table to be created for public schema
class CreatePerspectives < ActiveRecord::Migration
include MultiSchema
def up
with_in_schemas :only => :public do
# Create table perspectives
end
end
def down
with_in_schemas :only => :public do
drop_table :prespectives
end
end
end
Table to be created for private schemas
class CreateObjectives < ActiveRecord::Migration
include MultiSchema
def change
with_in_schemas :except => :public do
# Create objectives table
end
end
end
schema.rb
ActiveRecord::Schema.define(version: 20130810172443) do
create_table "perspectives", force: true do |t|
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
end
end