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:
authorShinya Maeda <shinya@gitlab.com>2018-11-12 04:38:39 +0300
committerShinya Maeda <shinya@gitlab.com>2018-11-13 09:23:38 +0300
commit632d9b26935458259ddcf0c56b0f6d098afd9337 (patch)
treee3bdef0c06b512dfd67353aaca9ece5d33f6b39a /db/migrate/20181112103239_drop_default_value_on_status_deployments.rb
parentdbb342d4d95d24a1313c64be4a923ea5f759d3fa (diff)
Drop default value on status column in deployments table
Diffstat (limited to 'db/migrate/20181112103239_drop_default_value_on_status_deployments.rb')
-rw-r--r--db/migrate/20181112103239_drop_default_value_on_status_deployments.rb18
1 files changed, 18 insertions, 0 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