summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-11-20 09:29:08 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-11-20 09:29:08 +0000
commit320ae6223d26e3fa565cb18d5d0b7d571032d948 (patch)
tree8fdf3ff95ddb1d804ec70e21737ccb73619282fd
parentf67f5917181051cad7f5a52a0f45dabd3abd94b3 (diff)
parentae949093b318db1f39e046377f6c46d86dc4b1ac (diff)
downloadgitlab-ce-320ae6223d26e3fa565cb18d5d0b7d571032d948.tar.gz
Merge branch 'drop-default-value-status-deployments' into 'master'
Drop default value on status column in deployments table Closes #53702 See merge request gitlab-org/gitlab-ce!22971
-rw-r--r--changelogs/unreleased/drop-default-value-status-deployments.yml5
-rw-r--r--db/migrate/20181112103239_drop_default_value_on_status_deployments.rb14
-rw-r--r--db/schema.rb4
3 files changed, 21 insertions, 2 deletions
diff --git a/changelogs/unreleased/drop-default-value-status-deployments.yml b/changelogs/unreleased/drop-default-value-status-deployments.yml
new file mode 100644
index 00000000000..fdb826a0507
--- /dev/null
+++ b/changelogs/unreleased/drop-default-value-status-deployments.yml
@@ -0,0 +1,5 @@
+---
+title: Drop default value on status column in deployments table
+merge_request: 22971
+author:
+type: other
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..a480c15e66b
--- /dev/null
+++ b/db/migrate/20181112103239_drop_default_value_on_status_deployments.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class DropDefaultValueOnStatusDeployments < ActiveRecord::Migration
+ DOWNTIME = false
+ DEPLOYMENT_STATUS_SUCCESS = 2 # Equivalent to Deployment.state_machine.states['success'].value
+
+ 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 8e02f43f702..cc47368c530 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,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"
@@ -807,7 +807,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"
t.index ["created_at"], name: "index_deployments_on_created_at", using: :btree
t.index ["deployable_type", "deployable_id"], name: "index_deployments_on_deployable_type_and_deployable_id", using: :btree