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
4c2cf907
Commit
4c2cf907
authored
May 08, 2018
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add DB constraint ci_runners.runner_type not null
parent
2de67448
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
db/migrate/20180508135515_set_runner_type_not_null.rb
db/migrate/20180508135515_set_runner_type_not_null.rb
+9
-0
db/schema.rb
db/schema.rb
+2
-2
spec/factories/ci/runners.rb
spec/factories/ci/runners.rb
+2
-0
No files found.
db/migrate/20180508135515_set_runner_type_not_null.rb
0 → 100644
View file @
4c2cf907
class
SetRunnerTypeNotNull
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
def
change
change_column_null
(
:ci_runners
,
:runner_type
,
false
)
end
end
db/schema.rb
View file @
4c2cf907
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20180508
055821
)
do
ActiveRecord
::
Schema
.
define
(
version:
20180508
135515
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -497,7 +497,7 @@ ActiveRecord::Schema.define(version: 20180508055821) do
t
.
integer
"access_level"
,
default:
0
,
null:
false
t
.
string
"ip_address"
t
.
integer
"maximum_timeout"
t
.
integer
"runner_type"
,
limit:
2
t
.
integer
"runner_type"
,
limit:
2
,
null:
false
end
add_index
"ci_runners"
,
[
"contacted_at"
],
name:
"index_ci_runners_on_contacted_at"
,
using: :btree
...
...
spec/factories/ci/runners.rb
View file @
4c2cf907
...
...
@@ -6,6 +6,7 @@ FactoryBot.define do
is_shared
false
active
true
access_level
:not_protected
runner_type
:project_type
trait
:online
do
contacted_at
Time
.
now
...
...
@@ -13,6 +14,7 @@ FactoryBot.define do
trait
:shared
do
is_shared
true
runner_type
:instance_type
end
trait
:specific
do
...
...
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