Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
9507f394
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9507f394
编写于
9月 06, 2017
作者:
A
Alexis Reigel
提交者:
Alexis Reigel
4月 23, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add runners_token column to namespaces
上级
14c8dbc6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
0 deletion
+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
未找到文件。
app/models/group.rb
浏览文件 @
9507f394
...
...
@@ -9,6 +9,7 @@ class Group < Namespace
include
SelectForProjectAuthorization
include
LoadedInGroupList
include
GroupDescendant
include
TokenAuthenticatable
has_many
:group_members
,
->
{
where
(
requested_at:
nil
)
},
dependent: :destroy
,
as: :source
# rubocop:disable Cop/ActiveRecordDependent
alias_method
:members
,
:group_members
...
...
@@ -43,6 +44,9 @@ class Group < Namespace
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_destroy
:post_destroy_hook
after_save
:update_two_factor_requirement
...
...
db/migrate/20170906133745_add_runners_token_to_groups.rb
0 → 100644
浏览文件 @
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
浏览文件 @
9507f394
...
...
@@ -1270,6 +1270,7 @@ ActiveRecord::Schema.define(version: 20180418053107) do
t
.
boolean
"require_two_factor_authentication"
,
default:
false
,
null:
false
t
.
integer
"two_factor_grace_period"
,
default:
48
,
null:
false
t
.
integer
"cached_markdown_version"
t
.
string
"runners_token"
end
add_index
"namespaces"
,
[
"created_at"
],
name:
"index_namespaces_on_created_at"
,
using: :btree
...
...
@@ -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_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"
,
[
"runners_token"
],
name:
"index_namespaces_on_runners_token"
,
unique:
true
,
using: :btree
add_index
"namespaces"
,
[
"type"
],
name:
"index_namespaces_on_type"
,
using: :btree
create_table
"notes"
,
force: :cascade
do
|
t
|
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录