summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-09-14 18:34:59 +0000
committerStan Hu <stanhu@gmail.com>2017-09-14 18:34:59 +0000
commit06b1e8ec9a0459f541c23027856df27e25940c01 (patch)
tree66a9cb5ee7f50fded51528af658a399322b93aa1 /db/migrate
parent66773772ed89de2808d8f452765f9497070d5e25 (diff)
parent9230caa907156354d6b9889eee1c4e30a4737471 (diff)
downloadgitlab-ce-06b1e8ec9a0459f541c23027856df27e25940c01.tar.gz
Merge branch 'ci-environment-status-performance' into 'master'
Constrain environment deployments to project IDs Closes #36877 See merge request gitlab-org/gitlab-ce!14252
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20170913131410_environments_project_id_not_null.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20170913131410_environments_project_id_not_null.rb b/db/migrate/20170913131410_environments_project_id_not_null.rb
new file mode 100644
index 00000000000..d5404f8ede9
--- /dev/null
+++ b/db/migrate/20170913131410_environments_project_id_not_null.rb
@@ -0,0 +1,16 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class EnvironmentsProjectIdNotNull < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ change_column_null :environments, :project_id, false
+ end
+
+ def down
+ change_column_null :environments, :project_id, true
+ end
+end