X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a3c5fac3f7849cab38bedd313b522b994be17b15..23721458d7ec8c44c4b54f45eb7d2a4e6d7cdce1:/services/api/db/migrate/20140422011506_pipeline_instance_state.rb diff --git a/services/api/db/migrate/20140422011506_pipeline_instance_state.rb b/services/api/db/migrate/20140422011506_pipeline_instance_state.rb index a3bc7fe9af..7643b18d85 100644 --- a/services/api/db/migrate/20140422011506_pipeline_instance_state.rb +++ b/services/api/db/migrate/20140422011506_pipeline_instance_state.rb @@ -2,13 +2,10 @@ class PipelineInstanceState < ActiveRecord::Migration include CurrentApiClient def up - if !column_exists?(:pipeline_instances, :state) - add_column :pipeline_instances, :state, :string - end + add_column :pipeline_instances, :state, :string + add_column :pipeline_instances, :components_summary, :text - if !column_exists?(:pipeline_instances, :components_summary) - add_column :pipeline_instances, :components_summary, :text - end + PipelineInstance.reset_column_information act_as_system_user do PipelineInstance.all.each do |pi| @@ -18,7 +15,7 @@ class PipelineInstanceState < ActiveRecord::Migration if pi[:active] == true pi.state = PipelineInstance::RunningOnServer else - if PipelineInstance.is_ready pi.components + if pi.components_look_ready? pi.state = PipelineInstance::Ready else pi.state = PipelineInstance::New @@ -34,6 +31,7 @@ class PipelineInstanceState < ActiveRecord::Migration end end +# We want to perform addition of state, and removal of active and success in two phases. Hence comment these statements out. =begin if column_exists?(:pipeline_instances, :active) remove_column :pipeline_instances, :active @@ -46,6 +44,7 @@ class PipelineInstanceState < ActiveRecord::Migration end def down +# We want to perform addition of state, and removal of active and success in two phases. Hence comment these statements out. =begin add_column :pipeline_instances, :success, :boolean, :null => true add_column :pipeline_instances, :active, :boolean, :default => false