rails
rails copied to clipboard
Adds schema parameter into enable_extension
Summary
This patch tries to solve Heroku's new PostgreSQL extension policy while keeping the migration and schema code idiomatic.
PostgreSQL adapter method enable_extension
now allows to add an schema in its name.
The extension must be installed on another schema.
Usage:
enable_extension('other_schema.hstore')
The enable_extension
can work with schema
only if the given schema
already exists in the database.
@lomefin thank you for the PR.
Rather than an extra argument, could we use the same pattern as in https://github.com/rails/rails/pull/45707?
So it would be enable_extension('other_schema.hstore')
Good idea.
Please squash your commits when you're happy with this.
I'm having issues on 2.7 on ActiveSupport's OptimizedMemCacheStoreTest#test_big5_hkscs_encoded_values
Any ideas how this commit is affecting that method or its an already existing error?
I'm having issues on 2.7 on ActiveSupport's
OptimizedMemCacheStoreTest#test_big5_hkscs_encoded_values
I believe that's just a flaky MemCache failure, I wouldn't worry about it
Yeah, I guess so. There is also another error
PostgresqlTimestampFixtureTest#test_bc_timestamp
Which is the procedure for disregarding those issues? Just mention them here or should I do something else?
Just mention them here or should I do something else?
Just mentioning here is fine - core/committers are usually pretty aware of which tests are flakey or related to this PR. The one you just observed is already logged here https://github.com/rails/rails/issues/45797
Would you address the conflict with the latest main branch?
done!
I overlooked the CI failure. Please address this error as suggested and squash your commits.
% ARCONN=postgresql bin/test test/cases/adapters/postgresql/extension_migration_test.rb -n test_enable_extension_migration_with_schema
Using postgresql
Run options: -n test_enable_extension_migration_with_schema --seed 3125
# Running:
E
Error:
PostgresqlExtensionMigrationTest#test_enable_extension_migration_with_schema:
ArgumentError: wrong number of arguments (given 3, expected 4..5)
/Users/yahonda/src/github.com/rails/rails/activerecord/lib/active_record/migration.rb:1304:in `initialize'
/Users/yahonda/src/github.com/rails/rails/activerecord/test/cases/adapters/postgresql/extension_migration_test.rb:64:in `new'
/Users/yahonda/src/github.com/rails/rails/activerecord/test/cases/adapters/postgresql/extension_migration_test.rb:64:in `test_enable_extension_migration_with_schema'
bin/test test/cases/adapters/postgresql/extension_migration_test.rb:59
Finished in 0.008196s, 122.0107 runs/s, 0.0000 assertions/s.
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
%
Could you address the RuboCop offense below and squash commits?
activerecord/test/cases/adapters/postgresql/extension_migration_test.rb:65:1: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected.
I've got hyper confused trying to re-squash the PR and got stuck. I'm sorry for the delay.
I decided to start anew, I made a new PR so I'll close this one. Thanks for all the comments, it has been very helpful.
The subsequent PR: https://github.com/rails/rails/pull/46894