Lex
Lex

Reputation: 5014

Rails postgres structure.sql remove schema name

I've pulled down a Rails repo (# ruby '2.5.0', gem 'rails', '~> 5.1', gem 'pg', '~>1.0', & psql 9.6.8) When running rake db:structure:dump the structure.sql is modified and the schema name gets added to the table create statements. Other than that the structure is unmodified. How do I remove them to stop collisions with the existing project.

CREATE TABLE public.account_roles (

When it was previously

SET search_path = public, pg_catalog;
...
CREATE TABLE account_roles (

The SET search_path also gets removed. I tried setting schema_search_path: 'public,pg_catelog' in database.yml configuration. This has no effect. What configuration was set to dump the sql structure without the schema?

Upvotes: 2

Views: 1191

Answers (1)

Lex
Lex

Reputation: 5014

The issue was caused by a newer version of Postgres being installed on my local.

We confirmed the issue by having another dev with the same project update their postgres version.

Knowing that we committed the new version into the repo and had everyone upgrade. And are working on dockerizing the project so things like psql version will remain consistent.

Upvotes: 1

Related Questions