-
Notifications
You must be signed in to change notification settings - Fork 25
Introduce the 'partman_5_compatibility_mode' config option #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: partman-migration
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,6 @@ | |
end | ||
|
||
describe "config" do | ||
after(:each) do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unrelated cleanup, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sort of. We moved this hook into the spec helper so the config universally gets reset after each test. We did this so we could easily set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We decided that, yes, we should. Pushed up a commit to address |
||
PgHaMigrations.instance_variable_set(:@config, nil) | ||
end | ||
|
||
describe "disable_default_migration_methods" do | ||
it "is set to true by default" do | ||
expect(PgHaMigrations.config.disable_default_migration_methods).to be(true) | ||
|
@@ -83,6 +79,20 @@ | |
expect(PgHaMigrations.config.infer_primary_key_on_partitioned_tables).to be(false) | ||
end | ||
end | ||
|
||
describe "partman_5_compatibility_mode" do | ||
it "is set to false by default" do | ||
expect(PgHaMigrations.config.partman_5_compatibility_mode).to be(false) | ||
end | ||
|
||
it "can be overriden to true" do | ||
PgHaMigrations.configure do |config| | ||
config.partman_5_compatibility_mode = true | ||
end | ||
|
||
expect(PgHaMigrations.config.partman_5_compatibility_mode).to be(true) | ||
end | ||
end | ||
end | ||
|
||
PgHaMigrations::AllowedVersions::ALLOWED_VERSIONS.each do |migration_klass| | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When will we plan to flip this to
true
? I'm not sure we'd want to wait until a major version of this gem, but...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In reality, I wouldn't expect there to be a ton of users in the community utilizing the partman functionality in this gem. On the BT side of things, I'm imagining we would flip this to
true
in our initializers very soon. So I think we should just follow semantic versioning and wait until 3.0 to flip the default totrue
. Honestly, in 3.0 we could probably just remove this config entirely and drop support for partman 4