Add ActiveRecord::SchemaDumper.ignore_extensions #55354
Open
+62 −2
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Motivation / Background
there are times when we want to have postgresql extensions running in production but not in development or test. examples are
pg_partmanandpg_cron- both of these are useful in production environments but having them listed indb/schema.rbcauses 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 indb/schema.rb.Detail
This Pull Request adds a new
ActiveRecord::SchemaDumper.ignore_extensionsconfiguration value which is analogous to the existingActiveRecord::SchemaDumper.ignore_tablesfunctionality.Additional information
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]