Skip to content
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

Merged
merged 1 commit into from
May 31, 2018

Conversation

agrare
Copy link
Member

@agrare agrare commented May 25, 2018

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

@agrare
Copy link
Member Author

agrare commented May 25, 2018

@miq-bot assign @Fryguy

@agrare agrare force-pushed the add_deleted_on_to_service_templates branch from 3a20bb7 to f84a0f8 Compare May 25, 2018 19:24
@agrare agrare force-pushed the add_deleted_on_to_service_templates branch from f84a0f8 to b01696c Compare May 25, 2018 19:27
@miq-bot
Copy link
Member

miq-bot commented May 25, 2018

Checked commit agrare@b01696c with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍪

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!
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@agrare agrare May 29, 2018

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!

Copy link
Member

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.

@Fryguy Fryguy merged commit f6ded86 into ManageIQ:master May 31, 2018
@Fryguy Fryguy added this to the Sprint 87 Ending Jun 4, 2018 milestone May 31, 2018
@agrare agrare deleted the add_deleted_on_to_service_templates branch May 31, 2018 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants