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
68cb1c26
Commit
68cb1c26
authored
Jun 08, 2018
by
Mark Chao
Committed by
Yorick Peterse
Jun 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert rename allow collaboration column
parent
e1f9f3c6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
8 deletions
+56
-8
app/models/merge_request.rb
app/models/merge_request.rb
+4
-1
db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb
...3042841_rename_merge_requests_allow_maintainer_to_push.rb
+4
-2
db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb
...180608110058_rename_merge_requests_allow_collaboration.rb
+21
-0
db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb
...cleanup_merge_requests_allow_maintainer_to_push_rename.rb
+4
-2
db/post_migrate/20180608201435_cleanup_merge_requests_allow_collaboration_rename.rb
...1435_cleanup_merge_requests_allow_collaboration_rename.rb
+20
-0
db/schema.rb
db/schema.rb
+2
-2
spec/lib/gitlab/import_export/safe_model_attributes.yml
spec/lib/gitlab/import_export/safe_model_attributes.yml
+1
-1
No files found.
app/models/merge_request.rb
View file @
68cb1c26
...
...
@@ -1125,8 +1125,11 @@ class MergeRequest < ActiveRecord::Base
project
.
merge_requests
.
merged
.
where
(
author_id:
author_id
).
empty?
end
# TODO: remove once production database rename completes
alias_attribute
:allow_collaboration
,
:allow_maintainer_to_push
def
allow_collaboration
collaborative_push_possible?
&&
super
collaborative_push_possible?
&&
allow_maintainer_to_push
end
alias_method
:allow_collaboration?
,
:allow_collaboration
...
...
db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb
View file @
68cb1c26
...
...
@@ -6,10 +6,12 @@ class RenameMergeRequestsAllowMaintainerToPush < ActiveRecord::Migration
disable_ddl_transaction!
def
up
rename_column_concurrently
:merge_requests
,
:allow_maintainer_to_push
,
:allow_collaboration
# NOOP
end
def
down
cleanup_concurrent_column_rename
:merge_requests
,
:allow_collaboration
,
:allow_maintainer_to_push
if
column_exists?
(
:merge_requests
,
:allow_collaboration
)
cleanup_concurrent_column_rename
:merge_requests
,
:allow_collaboration
,
:allow_maintainer_to_push
end
end
end
db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb
0 → 100644
View file @
68cb1c26
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
RenameMergeRequestsAllowCollaboration
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
disable_ddl_transaction!
def
up
if
column_exists?
(
:merge_requests
,
:allow_collaboration
)
rename_column_concurrently
:merge_requests
,
:allow_collaboration
,
:allow_maintainer_to_push
end
end
def
down
# NOOP
end
end
db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb
View file @
68cb1c26
...
...
@@ -6,10 +6,12 @@ class CleanupMergeRequestsAllowMaintainerToPushRename < ActiveRecord::Migration
disable_ddl_transaction!
def
up
cleanup_concurrent_column_rename
:merge_requests
,
:allow_maintainer_to_push
,
:allow_collaboration
# NOOP
end
def
down
rename_column_concurrently
:merge_requests
,
:allow_collaboration
,
:allow_maintainer_to_push
if
column_exists?
(
:merge_requests
,
:allow_collaboration
)
rename_column_concurrently
:merge_requests
,
:allow_collaboration
,
:allow_maintainer_to_push
end
end
end
db/post_migrate/20180608201435_cleanup_merge_requests_allow_collaboration_rename.rb
0 → 100644
View file @
68cb1c26
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
CleanupMergeRequestsAllowCollaborationRename
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
if
column_exists?
(
:merge_requests
,
:allow_collaboration
)
cleanup_concurrent_column_rename
:merge_requests
,
:allow_collaboration
,
:allow_maintainer_to_push
end
end
def
down
# NOOP
end
end
db/schema.rb
View file @
68cb1c26
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2018060
3190921
)
do
ActiveRecord
::
Schema
.
define
(
version:
2018060
8201435
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -1231,8 +1231,8 @@ ActiveRecord::Schema.define(version: 20180603190921) do
t
.
boolean
"discussion_locked"
t
.
integer
"latest_merge_request_diff_id"
t
.
string
"rebase_commit_sha"
t
.
boolean
"allow_collaboration"
t
.
boolean
"squash"
,
default:
false
,
null:
false
t
.
boolean
"allow_maintainer_to_push"
end
add_index
"merge_requests"
,
[
"assignee_id"
],
name:
"index_merge_requests_on_assignee_id"
,
using: :btree
...
...
spec/lib/gitlab/import_export/safe_model_attributes.yml
View file @
68cb1c26
...
...
@@ -170,7 +170,7 @@ MergeRequest:
-
last_edited_by_id
-
head_pipeline_id
-
discussion_locked
-
allow_
collaboration
-
allow_
maintainer_to_push
MergeRequestDiff
:
-
id
-
state
...
...
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