-
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
Add deleted_on to ServiceTemplate for archival #207
Add deleted_on to ServiceTemplate for archival #207
Conversation
073355f
to
3a20bb7
Compare
3a20bb7
to
f84a0f8
Compare
f84a0f8
to
b01696c
Compare
Checked commit agrare@b01696c with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
say_with_time("Migrate data from service_templates to reserved table") do | ||
ServiceTemplate.includes(:reserved_rec).each do |st| | ||
st.reserved_hash_set(:deleted_on, st.deleted_on) | ||
st.save! |
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.
Is there no reversed migrate method?
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.
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.
This is how all of our reserved table down migrations are today but I can write a reserved_hash_migrate down equivalent if you want.
reserved_hash_unmigrate/migrate_down
or something? It would just be self.reserved_hash_set(k, v); self.save!
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.
That's weird...oh well, we can make that for the future.
This adds a deleted_on datetime column to service_templates to allow for the use of the ArchivedMixin.
Also included here is code to migrate this out of the reserved table since this is intended to be backported.
ManageIQ/manageiq-v2v#314
Core change: ManageIQ/manageiq#17480
Backport: ManageIQ/manageiq#17481