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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
2acb8a30
Commit
2acb8a30
authored
Jul 25, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change merge request diff index to be not uniq
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
8e9b6019
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
7 deletions
+45
-7
db/migrate/20160725104020_merge_request_diff_remove_uniq.rb
db/migrate/20160725104020_merge_request_diff_remove_uniq.rb
+21
-0
db/migrate/20160725104452_merge_request_diff_add_index.rb
db/migrate/20160725104452_merge_request_diff_add_index.rb
+17
-0
db/schema.rb
db/schema.rb
+7
-7
No files found.
db/migrate/20160725104020_merge_request_diff_remove_uniq.rb
0 → 100644
View file @
2acb8a30
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
MergeRequestDiffRemoveUniq
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
disable_ddl_transaction!
DOWNTIME
=
false
def
up
if
index_exists?
(
:merge_request_diffs
,
:merge_request_id
)
remove_index
:merge_request_diffs
,
:merge_request_id
end
end
def
down
unless
index_exists?
(
:merge_request_diffs
,
:merge_request_id
)
add_concurrent_index
:merge_request_diffs
,
:merge_request_id
,
unique:
true
end
end
end
db/migrate/20160725104452_merge_request_diff_add_index.rb
0 → 100644
View file @
2acb8a30
class
MergeRequestDiffAddIndex
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
disable_ddl_transaction!
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
def
up
add_concurrent_index
:merge_request_diffs
,
:merge_request_id
end
def
down
if
index_exists?
(
:merge_request_diffs
,
:merge_request_id
)
remove_index
:merge_request_diffs
,
:merge_request_id
end
end
end
db/schema.rb
View file @
2acb8a30
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2016072
6093600
)
do
ActiveRecord
::
Schema
.
define
(
version:
2016072
5104452
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -84,8 +84,8 @@ ActiveRecord::Schema.define(version: 20160726093600) do
t
.
string
"health_check_access_token"
t
.
boolean
"send_user_confirmation_email"
,
default:
false
t
.
integer
"container_registry_token_expire_delay"
,
default:
5
t
.
boolean
"user_default_external"
,
default:
false
,
null:
false
t
.
text
"after_sign_up_text"
t
.
boolean
"user_default_external"
,
default:
false
,
null:
false
t
.
string
"repository_storage"
,
default:
"default"
t
.
string
"enabled_git_access_protocol"
t
.
boolean
"domain_blacklist_enabled"
,
default:
false
...
...
@@ -167,8 +167,8 @@ ActiveRecord::Schema.define(version: 20160726093600) do
t
.
text
"artifacts_metadata"
t
.
integer
"erased_by_id"
t
.
datetime
"erased_at"
t
.
string
"environment"
t
.
datetime
"artifacts_expire_at"
t
.
string
"environment"
t
.
integer
"artifacts_size"
t
.
string
"when"
t
.
text
"yaml_variables"
...
...
@@ -605,7 +605,7 @@ ActiveRecord::Schema.define(version: 20160726093600) do
t
.
string
"start_commit_sha"
end
add_index
"merge_request_diffs"
,
[
"merge_request_id"
],
name:
"index_merge_request_diffs_on_merge_request_id"
,
u
nique:
true
,
u
sing: :btree
add_index
"merge_request_diffs"
,
[
"merge_request_id"
],
name:
"index_merge_request_diffs_on_merge_request_id"
,
using: :btree
create_table
"merge_requests"
,
force: :cascade
do
|
t
|
t
.
string
"target_branch"
,
null:
false
...
...
@@ -782,10 +782,10 @@ ActiveRecord::Schema.define(version: 20160726093600) do
t
.
integer
"user_id"
,
null:
false
t
.
string
"token"
,
null:
false
t
.
string
"name"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
boolean
"revoked"
,
default:
false
t
.
datetime
"expires_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
add_index
"personal_access_tokens"
,
[
"token"
],
name:
"index_personal_access_tokens_on_token"
,
unique:
true
,
using: :btree
...
...
@@ -847,8 +847,8 @@ ActiveRecord::Schema.define(version: 20160726093600) do
t
.
boolean
"only_allow_merge_if_build_succeeds"
,
default:
false
,
null:
false
t
.
boolean
"has_external_issue_tracker"
t
.
string
"repository_storage"
,
default:
"default"
,
null:
false
t
.
boolean
"has_external_wiki"
t
.
boolean
"request_access_enabled"
,
default:
true
,
null:
false
t
.
boolean
"has_external_wiki"
end
add_index
"projects"
,
[
"builds_enabled"
,
"shared_runners_enabled"
],
name:
"index_projects_on_builds_enabled_and_shared_runners_enabled"
,
using: :btree
...
...
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