diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170503004426_add_retried_to_ci_build.rb | 10 | ||||
-rw-r--r-- | db/post_migrate/20170503004427_upate_retried_for_ci_build.rb | 2 | ||||
-rw-r--r-- | db/schema.rb | 2 |
3 files changed, 4 insertions, 10 deletions
diff --git a/db/migrate/20170503004426_add_retried_to_ci_build.rb b/db/migrate/20170503004426_add_retried_to_ci_build.rb index 9f509f97f14..2851e3de473 100644 --- a/db/migrate/20170503004426_add_retried_to_ci_build.rb +++ b/db/migrate/20170503004426_add_retried_to_ci_build.rb @@ -3,13 +3,7 @@ class AddRetriedToCiBuild < ActiveRecord::Migration DOWNTIME = false - disable_ddl_transaction! - - def up - add_column_with_default(:ci_builds, :retried, :boolean, default: false) - end - - def down - remove_column(:ci_builds, :retried) + def change + add_column(:ci_builds, :retried, :boolean) end end diff --git a/db/post_migrate/20170503004427_upate_retried_for_ci_build.rb b/db/post_migrate/20170503004427_upate_retried_for_ci_build.rb index e12180930a7..80215d662e4 100644 --- a/db/post_migrate/20170503004427_upate_retried_for_ci_build.rb +++ b/db/post_migrate/20170503004427_upate_retried_for_ci_build.rb @@ -20,7 +20,7 @@ class UpateRetriedForCiBuild < ActiveRecord::Migration is_retried = Arel.sql("((#{latest_id}) != ci_builds.id)") update_column_in_batches(:ci_builds, :retried, is_retried) do |table, query| - query.where(table[:retried].eq(false)) + query.where(table[:retried].eq(nil)) end end diff --git a/db/schema.rb b/db/schema.rb index 8046e9b48a7..a54a57bd4da 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -232,7 +232,7 @@ ActiveRecord::Schema.define(version: 20170504102911) do t.integer "lock_version" t.string "coverage_regex" t.integer "auto_canceled_by_id" - t.boolean "retried", default: false, null: false + t.boolean "retried" end add_index "ci_builds", ["commit_id", "stage_idx", "created_at"], name: "index_ci_builds_on_commit_id_and_stage_idx_and_created_at", using: :btree |