Skip to content

Conversation

@modosc
Copy link
Contributor

@modosc modosc commented Jul 17, 2025

Motivation / Background

there are times when we want to have postgresql extensions running in production but not in development or test. examples are pg_partman and pg_cron - both of these are useful in production environments but having them listed in db/schema.rb causes issues in development (because developers must install them and reconfigure postresql) and in test when running in ci (because we now have to build a custom docker image to run postgresql with these extensions since they don't ship in the standard postgresql docker images).

we also have this issue when we pull in copies of our production data locally. we run our production databases in aws aurora and by default it includes extensions that are vendor specific (eg rds_tools) which cannot be loaded or run in local environments. if we're running locally with a copy of our production database these extensions will show up in db/schema.rb.

Detail

This Pull Request adds a new ActiveRecord::SchemaDumper.ignore_extensions configuration value which is analogous to the existing ActiveRecord::SchemaDumper.ignore_tables functionality.

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.
@modosc modosc force-pushed the add-ignore-extensions-configu branch from 9a0069f to 7297885 Compare July 17, 2025 22:07
@modosc modosc marked this pull request as ready for review July 17, 2025 22:08
@modosc modosc force-pushed the add-ignore-extensions-configu branch from 7297885 to 4e0882d Compare July 17, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant