Why is my Rails `db/schema.rb` prefixing functions with `public`?

Viewed 439

Upon rebuilding my Postgresql database from a dump file using pg_restore, my schema file db/schema.rb is now prefixing the gen_random_uuid() function with public.

create_table "cars", id: :uuid, default: -> { "public.gen_random_uuid()" }

How can I prevent from the schema file from prefixing method calls with public?

1 Answers

Try adding config.active_record.dump_schema_after_migration = false in your environment's config file, e.g. #config/environments/production.rb (in the project you are dumping from), then dump and restore the db again on your local env.

Related