Sha256: 796779d019d60863c7c6db90d1730f9449d099ba398ff6fbe129ae635b3c2a17
Contents?: true
Size: 1.14 KB
Versions: 193
Compression:
Stored size: 1.14 KB
Contents
class AddActionToContentViewHistories < ActiveRecord::Migration[4.2] def up add_column :katello_content_view_histories, :action, :integer, default: 0 Katello::ContentViewHistory.reset_column_information Katello::ContentViewHistory.find_each do |history| task_label = history.task.try(:label) unless task_label history.delete next end case task_label when "Actions::Katello::ContentViewVersion::Export" history.action = Katello::ContentViewHistory.actions[:export] when "Actions::Katello::ContentView::Publish", "Actions::Katello::ContentView::IncrementalUpdates" history.action = Katello::ContentViewHistory.actions[:publish] when "Actions::Katello::ContentView::Promote" history.action = Katello::ContentViewHistory.actions[:promotion] when "Actions::Katello::ContentView::Remove" history.action = Katello::ContentViewHistory.actions[:removal] else fail "Cannot determine action for task label '#{task_label}'" end history.save! end end def down remove_column :katello_content_view_histories, :action end end
Version data entries
193 entries across 193 versions & 1 rubygems