Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/ci/migrate/20150528011012_move_job_name_to_build.rb')
-rw-r--r--db/ci/migrate/20150528011012_move_job_name_to_build.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/db/ci/migrate/20150528011012_move_job_name_to_build.rb b/db/ci/migrate/20150528011012_move_job_name_to_build.rb
new file mode 100644
index 00000000000..512ad47c5e6
--- /dev/null
+++ b/db/ci/migrate/20150528011012_move_job_name_to_build.rb
@@ -0,0 +1,10 @@
+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
+ end
+
+ def down
+ end
+end