diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-11-12 10:38:39 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-11-13 15:23:38 +0900 |
commit | 632d9b26935458259ddcf0c56b0f6d098afd9337 (patch) | |
tree | e3bdef0c06b512dfd67353aaca9ece5d33f6b39a | |
parent | dbb342d4d95d24a1313c64be4a923ea5f759d3fa (diff) | |
download | gitlab-ce-632d9b26935458259ddcf0c56b0f6d098afd9337.tar.gz |
Drop default value on status column in deployments table
-rw-r--r-- | db/migrate/20181112103239_drop_default_value_on_status_deployments.rb | 18 | ||||
-rw-r--r-- | db/schema.rb | 5 |
2 files changed, 21 insertions, 2 deletions
diff --git a/db/migrate/20181112103239_drop_default_value_on_status_deployments.rb b/db/migrate/20181112103239_drop_default_value_on_status_deployments.rb new file mode 100644 index 00000000000..9663095c55f --- /dev/null +++ b/db/migrate/20181112103239_drop_default_value_on_status_deployments.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class DropDefaultValueOnStatusDeployments < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + DEPLOYMENT_STATUS_SUCCESS = 2 # Equivalent to Deployment.state_machine.states['success'].value + + disable_ddl_transaction! + + def up + change_column_default :deployments, :status, :nil + end + + def down + change_column_default :deployments, :status, DEPLOYMENT_STATUS_SUCCESS + end +end diff --git a/db/schema.rb b/db/schema.rb index 56137caf1d7..1c941649e2d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20181107054254) do +ActiveRecord::Schema.define(version: 20181112103239) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -836,7 +836,7 @@ ActiveRecord::Schema.define(version: 20181107054254) do t.datetime "created_at" t.datetime "updated_at" t.string "on_stop" - t.integer "status", limit: 2, default: 2, null: false + t.integer "status", limit: 2, null: false t.datetime_with_timezone "finished_at" end @@ -1865,6 +1865,7 @@ ActiveRecord::Schema.define(version: 20181107054254) do end add_index "redirect_routes", ["path"], name: "index_redirect_routes_on_path", unique: true, using: :btree + add_index "redirect_routes", ["path"], name: "index_redirect_routes_on_path_text_pattern_ops", using: :btree, opclasses: {"path"=>"varchar_pattern_ops"} add_index "redirect_routes", ["source_type", "source_id"], name: "index_redirect_routes_on_source_type_and_source_id", using: :btree create_table "releases", force: :cascade do |t| |