summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-03 16:50:23 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-03 16:50:23 +0000
commit4f592051dd7daa44ead6048328114fd9927f717b (patch)
tree31b144bc4a67938e191897bbab000f29eca8cda1
parente6113010fc9541ffe8e9981b87bc291805769e55 (diff)
parent0cb18461890ecf514cab9ea4e7b236eeae3bef0d (diff)
downloadgitlab-ci-4f592051dd7daa44ead6048328114fd9927f717b.tar.gz
Merge branch 'migrate_job_names' into 'master'
Migrate job name to build name https://dev.gitlab.org/gitlab/gitlab-ci/issues/251 See merge request !117
-rw-r--r--db/migrate/20150528011012_remove_unused_fields.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/db/migrate/20150528011012_remove_unused_fields.rb b/db/migrate/20150528011012_remove_unused_fields.rb
index c8f5e89..2895169 100644
--- a/db/migrate/20150528011012_remove_unused_fields.rb
+++ b/db/migrate/20150528011012_remove_unused_fields.rb
@@ -1,5 +1,13 @@
class RemoveUnusedFields < ActiveRecord::Migration
- def change
+ 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