Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 334
Chris LaBarge Avatar asked Dec 09 '25 06:12

Chris LaBarge


1 Answers

I think the problem isn't rails specific, more pg_dump specific. If you read the dump, it probably creates the functions with the public. prefix?

Here's a similar problem which might help you out: How force pg_dump to (not) include scheme name for each objects in DDL

like image 75
Manuel van Rijn Avatar answered Dec 11 '25 21:12

Manuel van Rijn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!