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
1a416a42
Commit
1a416a42
authored
Mar 15, 2017
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Database migrations for protected tags
Added schema.rb for protected tags
parent
99859b01
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
1 deletion
+68
-1
db/migrate/20170309173138_create_protected_tags.rb
db/migrate/20170309173138_create_protected_tags.rb
+39
-0
db/schema.rb
db/schema.rb
+29
-1
No files found.
db/migrate/20170309173138_create_protected_tags.rb
0 → 100644
View file @
1a416a42
class
CreateProtectedTags
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
GitlabAccessMaster
=
40
def
change
create_table
:protected_tags
do
|
t
|
t
.
integer
:project_id
,
null:
false
t
.
string
:name
,
null:
false
t
.
string
:timestamps
#TODO: `null: false`? Missing from protected_branches
end
add_index
:protected_tags
,
:project_id
create_table
:protected_tag_merge_access_levels
do
|
t
|
t
.
references
:protected_tag
,
index:
{
name:
"index_protected_tag_merge_access"
},
foreign_key:
true
,
null:
false
t
.
integer
:access_level
,
default:
GitlabAccessMaster
,
null:
true
#TODO: was false, check schema
t
.
integer
:group_id
#TODO: check why group/user id missing from CE
t
.
integer
:user_id
t
.
timestamps
null:
false
end
create_table
:protected_tag_push_access_levels
do
|
t
|
t
.
references
:protected_tag
,
index:
{
name:
"index_protected_tag_push_access"
},
foreign_key:
true
,
null:
false
t
.
integer
:access_level
,
default:
GitlabAccessMaster
,
null:
true
#TODO: was false, check schema
t
.
integer
:group_id
t
.
integer
:user_id
t
.
timestamps
null:
false
end
#TODO: These had rubocop set to disable Migration/AddConcurrentForeignKey
# add_foreign_key :protected_tag_merge_access_levels, :namespaces, column: :group_id
# add_foreign_key :protected_tag_push_access_levels, :namespaces, column: :group_id
end
end
db/schema.rb
View file @
1a416a42
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2017031
5194013
)
do
ActiveRecord
::
Schema
.
define
(
version:
2017031
7203554
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -963,6 +963,32 @@ ActiveRecord::Schema.define(version: 20170315194013) do
add_index
"protected_branches"
,
[
"project_id"
],
name:
"index_protected_branches_on_project_id"
,
using: :btree
create_table
"protected_tag_merge_access_levels"
,
force: :cascade
do
|
t
|
t
.
integer
"protected_tag_id"
,
null:
false
t
.
integer
"access_level"
,
default:
40
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
add_index
"protected_tag_merge_access_levels"
,
[
"protected_tag_id"
],
name:
"index_protected_tag_merge_access"
,
using: :btree
create_table
"protected_tag_push_access_levels"
,
force: :cascade
do
|
t
|
t
.
integer
"protected_tag_id"
,
null:
false
t
.
integer
"access_level"
,
default:
40
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
add_index
"protected_tag_push_access_levels"
,
[
"protected_tag_id"
],
name:
"index_protected_tag_push_access"
,
using: :btree
create_table
"protected_tags"
,
force: :cascade
do
|
t
|
t
.
integer
"project_id"
,
null:
false
t
.
string
"name"
,
null:
false
t
.
string
"timestamps"
end
add_index
"protected_tags"
,
[
"project_id"
],
name:
"index_protected_tags_on_project_id"
,
using: :btree
create_table
"releases"
,
force: :cascade
do
|
t
|
t
.
string
"tag"
t
.
text
"description"
...
...
@@ -1305,6 +1331,8 @@ ActiveRecord::Schema.define(version: 20170315194013) do
add_foreign_key
"project_statistics"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"protected_branch_merge_access_levels"
,
"protected_branches"
add_foreign_key
"protected_branch_push_access_levels"
,
"protected_branches"
add_foreign_key
"protected_tag_merge_access_levels"
,
"protected_tags"
add_foreign_key
"protected_tag_push_access_levels"
,
"protected_tags"
add_foreign_key
"subscriptions"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"timelogs"
,
"issues"
,
name:
"fk_timelogs_issues_issue_id"
,
on_delete: :cascade
add_foreign_key
"timelogs"
,
"merge_requests"
,
name:
"fk_timelogs_merge_requests_merge_request_id"
,
on_delete: :cascade
...
...
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