class createListView < ActiveRecord::Migration
def up
execute <<-SQL
create view list as
SELECT
'House' AS type,
houses.id AS id
FROM houses
WHERE houses.id IS NOT NULL
UNION
SELECT
'Apartment' AS type,
apartments.id AS id,
FROM apartments
WHERE apartments.id IS NOT NULL;
SQL
end
def down
execute 'drop view list'
end
end
`
Expected behavior
a view is created on all tenant schemas
Actual behavior
schemas don't have the view, only the public schema has it.
Steps to reproduce
create a migration with raw sql in it,
for example:
`
`
Expected behavior
a view is created on all tenant schemas
Actual behavior
schemas don't have the view, only the public schema has it.
System configuration