After migrating my development database, I'm unable to run rails db:test:prepare.
My application uses the db/structure.sql file to update the test database:
# config/application.rb
config.active_record.schema_format = :sql
When I run rails db:migrate (which also runs db:structure:dump), my db/structure.sql is updated. Unfortunately, it now contains this line near the top after updating:
CREATE SCHEMA public;
This will bomb when loaded into a database that already contains the public schema.
I can manually update that line and the SQL dump loads successfully:
CREATE SCHEMA IF NOT EXISTS public;
...but I don't want to do that every time.
I expect the test database to be built successfully from the SQL dump in db/structure.sql when I run rails db:test:prepare because the SQL dump should not try to create the public schema.