-
Notifications
You must be signed in to change notification settings - Fork 125
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
Update ResourceGroup type for Azure #131
Conversation
end | ||
|
||
def change | ||
ResourceGroup.update_all(:type => 'ManageIQ::Providers::Azure::ResourceGroup') |
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.
Please wrap this in a say_with_time
like other data migrations.
self.inheritance_column = :_type_disabled | ||
end | ||
|
||
def change |
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.
Will this work in a change
? I would expect this data migration only on up, and then on down, I guess it would get set back to ResourceGroup
.
@Fryguy updated. |
@djberg96 can you add a |
@blomquisg Updated. |
let(:resource_group_stub) { migration_stub :ResourceGroup } | ||
let(:expected_type) { 'ManageIQ::Providers::Azure::ResourceGroup' } | ||
|
||
migration_context :up do |
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.
Add the corresponding migration_context :down
test, too.
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.
Done.
Add a down method that sets the type to ResourceGroup. Add specs for down migration.
Checked commit https://github.com/djberg96/manageiq-schema/commit/221a0e7e5c5441571498ff393976c0e0f435af2f with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 db/migrate/20171117201519_update_resource_group_type_for_azure.rb
|
Update ResourceGroup type for Azure (cherry picked from commit bc49956) https://bugzilla.redhat.com/show_bug.cgi?id=1515452
Gaprindashvili backport details:
|
This sets the
:type
column of the ResourceGroup table to the appropriate type. Since Azure is the only provider using this table at this time, we update all records.This is a continuation of #123.
One of several PR's that goes towards fixing:
https://bugzilla.redhat.com/show_bug.cgi?id=1503295