summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/migrate/20150528011012_move_job_name_to_build.rb (renamed from db/migrate/20150528011012_remove_unused_fields.rb)5
1 files changed, 1 insertions, 4 deletions
diff --git a/db/migrate/20150528011012_remove_unused_fields.rb b/db/migrate/20150528011012_move_job_name_to_build.rb
index 2895169..512ad47 100644
--- a/db/migrate/20150528011012_remove_unused_fields.rb
+++ b/db/migrate/20150528011012_move_job_name_to_build.rb
@@ -1,13 +1,10 @@
-class RemoveUnusedFields < ActiveRecord::Migration
+class MoveJobNameToBuild < ActiveRecord::Migration
def up
select_all("SELECT id, name FROM jobs").each do |job|
execute("UPDATE builds SET name = '#{quote_string(job["name"])}' WHERE job_id = #{job["id"]}")
end
-
- remove_column :builds, :job_id, :integer
end
def down
- add_column :builds, :job_id, :integer
end
end