Disallow NULL values for environments.project_id
This commit is contained in:
parent
f04094a4f8
commit
9230caa907
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: "Disallow NULL values for environments.project_id"
|
||||
merge_request:
|
||||
author:
|
||||
type: other
|
|
@ -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
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue