diff options
author | Valery Sizov <valery@gitlab.com> | 2015-06-17 08:25:53 +0000 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2015-06-17 08:25:53 +0000 |
commit | 311d6ea22f4b221e0740eb3c56e271806b5cc57c (patch) | |
tree | cbf67d7da9834eb2fbd4c0cc04cdcece7564cc88 | |
parent | 58dcfe0e3d3bb7b12e3f7aa4aed49bd0cc97c912 (diff) | |
parent | 50b17ef21b610774c7dfed73f243d507149d9125 (diff) | |
download | gitlab-ci-311d6ea22f4b221e0740eb3c56e271806b5cc57c.tar.gz |
Merge branch 'fix_migration_builds' into 'master'
Prevent job_id removing
I would prefer to keep field job_id in the builds table. It will allow us much room for manoeuvre.
Of course it is not the best practice to change migration because it can lead to different database states for users but we will remove this filed soon anyway. We will need to put condition there if this field exist.
See merge request !142
-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 |