chore: Allow schema configuration#809
chore: Allow schema configuration#809maxforasteiro wants to merge 1 commit intopact-foundation:masterfrom
Conversation
|
Cheers for the change. Have added a few on for review, have you tested this out for your requirements? |
| * Copy the [pact\_broker](https://github.com/DiUS/pact_broker-docker/tree/master/pact_broker) directory from the Pact Broker Docker project. This will have the recommended settings for database connections, logging, basic auth etc. Note that the Docker image uses Phusion Passenger as the web application server in front of the Pact Broker Ruby application, which is the recommended set up if you are not using a containerized solution. | ||
| * Modify the config.ru and Gemfile as desired (eg. choose database driver gem, set your database credentials. Use the "pg" gem for Postgres) | ||
| * example Sequel configuration for postgres `{ adapter: "postgres", database: "pact_broker", username: 'pact_broker', password: 'pact_broker', :encoding => 'utf8' }` | ||
| * If you need to use a custom PostgreSQL schema instead of the default `public` schema, add the `search_path` parameter: `{ adapter: "postgres", database: "pact_broker", username: 'pact_broker', password: 'pact_broker', :encoding => 'utf8', :search_path => 'my_custom_schema' }`. |
There was a problem hiding this comment.
why search_path, and not schema here? same for other places it applies across the other files
| postgres: | ||
| <<: *default | ||
| adapter: postgres | ||
| search_path: public |
There was a problem hiding this comment.
we shouldn't need to explicitly specify here, if it defaults to public
| database_port: nil, | ||
| database_url: nil, | ||
| database_sslmode: nil, | ||
| database_schema: "public", # Default to public schema |
There was a problem hiding this comment.
does a default value need to be provided here? If one isn't provided, surely it defaults to public to preserve existing behaviour. can this attr be set to nil?
|
It looks like this has gone stale... @YOU54F, should we incorporate the changes manually so we can merge this? I'm not very familiar with this part of the codebase. |
Yeah I can try and pick this up. I would probably just test manually, and ensure it retains the existing behaviour, whilst allowing others to setup a database with a specified schema. it may be that in a future 3.x release, we default to a named schema for new databases and users opt in to public, if recommendations against using the public schema is now the default in latest versions of pg |
Description
hey there, I made the changes with the help of AI™
I wasn't able to properly test it :D fixes #726