From e5ab4ce19d5ace5e6dd5cd32c23f50b35d20c8ef Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 9 Sep 2014 14:43:29 -0400 Subject: [PATCH] 3187: Migration to add started_at and finished_at to job_tasks and pipeline_instances. --- services/api/app/models/job_task.rb | 2 ++ services/api/app/models/pipeline_instance.rb | 2 ++ ...dd_start_finish_time_to_tasks_and_pipelines.rb | 15 +++++++++++++++ services/api/db/structure.sql | 10 ++++++++-- 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 services/api/db/migrate/20140909183946_add_start_finish_time_to_tasks_and_pipelines.rb diff --git a/services/api/app/models/job_task.rb b/services/api/app/models/job_task.rb index 4dcf2567d7..5f83fbe162 100644 --- a/services/api/app/models/job_task.rb +++ b/services/api/app/models/job_task.rb @@ -15,6 +15,8 @@ class JobTask < ArvadosModel t.add :output t.add :progress t.add :success + t.add :started_at + t.add :finished_at end protected diff --git a/services/api/app/models/pipeline_instance.rb b/services/api/app/models/pipeline_instance.rb index 354c8924e7..752391862a 100644 --- a/services/api/app/models/pipeline_instance.rb +++ b/services/api/app/models/pipeline_instance.rb @@ -22,6 +22,8 @@ class PipelineInstance < ArvadosModel t.add :properties t.add :state t.add :components_summary + t.add :started_at + t.add :finished_at end # Supported states for a pipeline instance diff --git a/services/api/db/migrate/20140909183946_add_start_finish_time_to_tasks_and_pipelines.rb b/services/api/db/migrate/20140909183946_add_start_finish_time_to_tasks_and_pipelines.rb new file mode 100644 index 0000000000..139cb8d66f --- /dev/null +++ b/services/api/db/migrate/20140909183946_add_start_finish_time_to_tasks_and_pipelines.rb @@ -0,0 +1,15 @@ +class AddStartFinishTimeToTasksAndPipelines < ActiveRecord::Migration + def up + add_column :job_tasks, :started_at, :datetime + add_column :job_tasks, :finished_at, :datetime + add_column :pipeline_instances, :started_at, :datetime + add_column :pipeline_instances, :finished_at, :datetime + end + + def down + remove_column :job_tasks, :started_at + remove_column :job_tasks, :finished_at + remove_column :pipeline_instances, :started_at + remove_column :pipeline_instances, :finished_at + end +end diff --git a/services/api/db/structure.sql b/services/api/db/structure.sql index bd86826f38..2168739ddf 100644 --- a/services/api/db/structure.sql +++ b/services/api/db/structure.sql @@ -353,7 +353,9 @@ CREATE TABLE job_tasks ( created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, created_by_job_task_uuid character varying(255), - qsequence bigint + qsequence bigint, + started_at timestamp without time zone, + finished_at timestamp without time zone ); @@ -678,7 +680,9 @@ CREATE TABLE pipeline_instances ( properties text, state character varying(255), components_summary text, - description text + description text, + started_at timestamp without time zone, + finished_at timestamp without time zone ); @@ -2012,3 +2016,5 @@ INSERT INTO schema_migrations (version) VALUES ('20140818125735'); INSERT INTO schema_migrations (version) VALUES ('20140826180337'); INSERT INTO schema_migrations (version) VALUES ('20140828141043'); + +INSERT INTO schema_migrations (version) VALUES ('20140909183946'); \ No newline at end of file -- 2.30.2