Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
9230caa9
Commit
9230caa9
authored
Sep 13, 2017
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disallow NULL values for environments.project_id
parent
f04094a4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
changelogs/unreleased/disallow-null-values-for-environments-project-id.yml
...ased/disallow-null-values-for-environments-project-id.yml
+5
-0
db/migrate/20170913131410_environments_project_id_not_null.rb
...igrate/20170913131410_environments_project_id_not_null.rb
+16
-0
db/schema.rb
db/schema.rb
+2
-2
No files found.
changelogs/unreleased/disallow-null-values-for-environments-project-id.yml
0 → 100644
View file @
9230caa9
---
title
:
"
Disallow
NULL
values
for
environments.project_id"
merge_request
:
author
:
type
:
other
db/migrate/20170913131410_environments_project_id_not_null.rb
0 → 100644
View file @
9230caa9
# 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
db/schema.rb
View file @
9230caa9
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201709
05112933
)
do
ActiveRecord
::
Schema
.
define
(
version:
201709
13131410
)
do
# These are extensions that must be enabled in order to support this database
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
enable_extension
"plpgsql"
...
@@ -520,7 +520,7 @@ ActiveRecord::Schema.define(version: 20170905112933) do
...
@@ -520,7 +520,7 @@ ActiveRecord::Schema.define(version: 20170905112933) do
add_index
"emails"
,
[
"user_id"
],
name:
"index_emails_on_user_id"
,
using: :btree
add_index
"emails"
,
[
"user_id"
],
name:
"index_emails_on_user_id"
,
using: :btree
create_table
"environments"
,
force: :cascade
do
|
t
|
create_table
"environments"
,
force: :cascade
do
|
t
|
t
.
integer
"project_id"
t
.
integer
"project_id"
,
null:
false
t
.
string
"name"
,
null:
false
t
.
string
"name"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"updated_at"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment