When executing a migration the schema search path should not be included on the schema.rb since this is Environment dependant and will break on a different configuration:
Example of schema.rb generated because of scenic:
create_view "my_schema_search_path.foo", materialized: true, sql_definition: <<-SQL
SELECT * from foo;
SQL
add_index "my_schema_search_path.foo", ["bar"], name: "index_on_foo_bar"
Expected schema.rb appendix is:
create_view "foo", materialized: true, sql_definition: <<-SQL
SELECT * from foo;
SQL
add_index "foo", ["bar"], name: "index_on_foo_bar"
To be more specific, this breaks the following rake task for any env it runs with a different configuration than the one used to generate the schema.rb file.