3187: Migration to add started_at and finished_at to job_tasks and pipeline_instances.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 9 Sep 2014 18:43:29 +0000 (14:43 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 9 Sep 2014 18:43:29 +0000 (14:43 -0400)
services/api/app/models/job_task.rb
services/api/app/models/pipeline_instance.rb
services/api/db/migrate/20140909183946_add_start_finish_time_to_tasks_and_pipelines.rb [new file with mode: 0644]
services/api/db/structure.sql

index 4dcf2567d7865131a6a2bc025300c962ec360605..5f83fbe162568dd7694e35fe8a3e3d43ec37406e 100644 (file)
@@ -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
index 354c8924e78f691cce4f327edb75ca37ec261f71..752391862a3d2e25c9cfe26a85913496bd5145a6 100644 (file)
@@ -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 (file)
index 0000000..139cb8d
--- /dev/null
@@ -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
index bd86826f3859c52ae39a7fcc939dd8033df540f6..2168739ddf76b5f4acdbd84828c98d53b9c4383f 100644 (file)
@@ -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