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
a014b5e4
Commit
a014b5e4
authored
Jun 27, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add index to the project_registry table
parent
a1fc1593
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
db/geo/migrate/20170627195211_add_index_to_project_registry.rb
...o/migrate/20170627195211_add_index_to_project_registry.rb
+21
-0
db/geo/schema.rb
db/geo/schema.rb
+5
-1
No files found.
db/geo/migrate/20170627195211_add_index_to_project_registry.rb
0 → 100644
View file @
a014b5e4
class
AddIndexToProjectRegistry
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
:project_registry
,
:last_repository_synced_at
add_concurrent_index
:project_registry
,
:last_repository_successful_sync_at
add_concurrent_index
:project_registry
,
:resync_repository
add_concurrent_index
:project_registry
,
:resync_wiki
end
def
down
remove_concurrent_index
:project_registry
,
:last_repository_synced_at
if
index_exists?
(
:project_registry
,
:last_repository_synced_at
)
remove_concurrent_index
:project_registry
,
:last_repository_successful_sync_at
if
index_exists?
(
:project_registry
,
:last_repository_successful_sync_at
)
remove_concurrent_index
:project_registry
,
:resync_repository
if
index_exists?
(
:project_registry
,
:resync_repository
)
remove_concurrent_index
:project_registry
,
:resync_wiki
if
index_exists?
(
:project_registry
,
:resync_wiki
)
end
end
db/geo/schema.rb
View file @
a014b5e4
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201706
14201943
)
do
ActiveRecord
::
Schema
.
define
(
version:
201706
27195211
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -41,6 +41,10 @@ ActiveRecord::Schema.define(version: 20170614201943) do
t
.
datetime
"last_wiki_successful_sync_at"
end
add_index
"project_registry"
,
[
"last_repository_successful_sync_at"
],
name:
"index_project_registry_on_last_repository_successful_sync_at"
,
using: :btree
add_index
"project_registry"
,
[
"last_repository_synced_at"
],
name:
"index_project_registry_on_last_repository_synced_at"
,
using: :btree
add_index
"project_registry"
,
[
"project_id"
],
name:
"index_project_registry_on_project_id"
,
using: :btree
add_index
"project_registry"
,
[
"resync_repository"
],
name:
"index_project_registry_on_resync_repository"
,
using: :btree
add_index
"project_registry"
,
[
"resync_wiki"
],
name:
"index_project_registry_on_resync_wiki"
,
using: :btree
end
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