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
Léo-Paul Géneau
gitlab-ce
Commits
9507f394
Commit
9507f394
authored
Sep 06, 2017
by
Alexis Reigel
Committed by
Alexis Reigel
Apr 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add runners_token column to namespaces
parent
14c8dbc6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
app/models/group.rb
app/models/group.rb
+4
-0
db/migrate/20170906133745_add_runners_token_to_groups.rb
db/migrate/20170906133745_add_runners_token_to_groups.rb
+17
-0
db/schema.rb
db/schema.rb
+2
-0
No files found.
app/models/group.rb
View file @
9507f394
...
@@ -9,6 +9,7 @@ class Group < Namespace
...
@@ -9,6 +9,7 @@ class Group < Namespace
include
SelectForProjectAuthorization
include
SelectForProjectAuthorization
include
LoadedInGroupList
include
LoadedInGroupList
include
GroupDescendant
include
GroupDescendant
include
TokenAuthenticatable
has_many
:group_members
,
->
{
where
(
requested_at:
nil
)
},
dependent: :destroy
,
as: :source
# rubocop:disable Cop/ActiveRecordDependent
has_many
:group_members
,
->
{
where
(
requested_at:
nil
)
},
dependent: :destroy
,
as: :source
# rubocop:disable Cop/ActiveRecordDependent
alias_method
:members
,
:group_members
alias_method
:members
,
:group_members
...
@@ -43,6 +44,9 @@ class Group < Namespace
...
@@ -43,6 +44,9 @@ class Group < Namespace
validates
:two_factor_grace_period
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
validates
:two_factor_grace_period
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
add_authentication_token_field
:runners_token
before_save
:ensure_runners_token
after_create
:post_create_hook
after_create
:post_create_hook
after_destroy
:post_destroy_hook
after_destroy
:post_destroy_hook
after_save
:update_two_factor_requirement
after_save
:update_two_factor_requirement
...
...
db/migrate/20170906133745_add_runners_token_to_groups.rb
0 → 100644
View file @
9507f394
class
AddRunnersTokenToGroups
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_column
:namespaces
,
:runners_token
,
:string
add_concurrent_index
:namespaces
,
:runners_token
,
unique:
true
end
def
down
remove_column
:namespaces
,
:runners_token
end
end
db/schema.rb
View file @
9507f394
...
@@ -1270,6 +1270,7 @@ ActiveRecord::Schema.define(version: 20180418053107) do
...
@@ -1270,6 +1270,7 @@ ActiveRecord::Schema.define(version: 20180418053107) do
t
.
boolean
"require_two_factor_authentication"
,
default:
false
,
null:
false
t
.
boolean
"require_two_factor_authentication"
,
default:
false
,
null:
false
t
.
integer
"two_factor_grace_period"
,
default:
48
,
null:
false
t
.
integer
"two_factor_grace_period"
,
default:
48
,
null:
false
t
.
integer
"cached_markdown_version"
t
.
integer
"cached_markdown_version"
t
.
string
"runners_token"
end
end
add_index
"namespaces"
,
[
"created_at"
],
name:
"index_namespaces_on_created_at"
,
using: :btree
add_index
"namespaces"
,
[
"created_at"
],
name:
"index_namespaces_on_created_at"
,
using: :btree
...
@@ -1280,6 +1281,7 @@ ActiveRecord::Schema.define(version: 20180418053107) do
...
@@ -1280,6 +1281,7 @@ ActiveRecord::Schema.define(version: 20180418053107) do
add_index
"namespaces"
,
[
"path"
],
name:
"index_namespaces_on_path"
,
using: :btree
add_index
"namespaces"
,
[
"path"
],
name:
"index_namespaces_on_path"
,
using: :btree
add_index
"namespaces"
,
[
"path"
],
name:
"index_namespaces_on_path_trigram"
,
using: :gin
,
opclasses:
{
"path"
=>
"gin_trgm_ops"
}
add_index
"namespaces"
,
[
"path"
],
name:
"index_namespaces_on_path_trigram"
,
using: :gin
,
opclasses:
{
"path"
=>
"gin_trgm_ops"
}
add_index
"namespaces"
,
[
"require_two_factor_authentication"
],
name:
"index_namespaces_on_require_two_factor_authentication"
,
using: :btree
add_index
"namespaces"
,
[
"require_two_factor_authentication"
],
name:
"index_namespaces_on_require_two_factor_authentication"
,
using: :btree
add_index
"namespaces"
,
[
"runners_token"
],
name:
"index_namespaces_on_runners_token"
,
unique:
true
,
using: :btree
add_index
"namespaces"
,
[
"type"
],
name:
"index_namespaces_on_type"
,
using: :btree
add_index
"namespaces"
,
[
"type"
],
name:
"index_namespaces_on_type"
,
using: :btree
create_table
"notes"
,
force: :cascade
do
|
t
|
create_table
"notes"
,
force: :cascade
do
|
t
|
...
...
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