Commit 9230caa9 authored by Yorick Peterse's avatar Yorick Peterse

Disallow NULL values for environments.project_id

parent f04094a4
---
title: "Disallow NULL values for environments.project_id"
merge_request:
author:
type: other
# 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
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170905112933) do
ActiveRecord::Schema.define(version: 20170913131410) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -520,7 +520,7 @@ ActiveRecord::Schema.define(version: 20170905112933) do
add_index "emails", ["user_id"], name: "index_emails_on_user_id", using: :btree
create_table "environments", force: :cascade do |t|
t.integer "project_id"
t.integer "project_id", null: false
t.string "name", null: false
t.datetime "created_at"
t.datetime "updated_at"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment