summaryrefslogtreecommitdiff
path: root/db/migrate/20181112103239_drop_default_value_on_status_deployments.rb
diff options
context:
space:
mode:
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.rb14
1 files changed, 14 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..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