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
c30983d6
Commit
c30983d6
authored
Jun 22, 2020
by
Robert Hunt
Committed by
Toon Claes
Jun 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to remove the old index
Reverts to the old index on removal
parent
f3a8bd29
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
db/migrate/20200616145031_add_author_id_index_to_audit_events.rb
...ate/20200616145031_add_author_id_index_to_audit_events.rb
+5
-2
db/structure.sql
db/structure.sql
+1
-3
No files found.
db/migrate/20200616145031_add_author_id_index_to_audit_events.rb
View file @
c30983d6
...
...
@@ -7,13 +7,16 @@ class AddAuthorIdIndexToAuditEvents < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
INDEX_NAME
=
'index_on_author_id_and_entity_id_and_entity_type_and_id_desc'
.
freeze
INDEX_NAME
=
'index_on_entity_id_and_entity_type_and_id_desc_and_author_id'
.
freeze
OLD_INDEX_NAME
=
'index_audit_events_on_entity_id_and_entity_type_and_id_desc'
.
freeze
def
up
add_concurrent_index
(
:audit_events
,
[
:author_id
,
:entity_id
,
:entity_type
,
:id
],
order:
{
id: :desc
},
name:
INDEX_NAME
)
add_concurrent_index
(
:audit_events
,
[
:entity_id
,
:entity_type
,
:id
,
:author_id
],
order:
{
id: :desc
},
name:
INDEX_NAME
)
remove_concurrent_index_by_name
(
:audit_events
,
OLD_INDEX_NAME
)
end
def
down
add_concurrent_index
(
:audit_events
,
[
:entity_id
,
:entity_type
,
:id
],
order:
{
id: :desc
},
name:
OLD_INDEX_NAME
)
remove_concurrent_index_by_name
(
:audit_events
,
INDEX_NAME
)
end
end
db/structure.sql
View file @
c30983d6
...
...
@@ -9419,8 +9419,6 @@ CREATE INDEX index_approvers_on_target_id_and_target_type ON public.approvers US
CREATE
INDEX
index_approvers_on_user_id
ON
public
.
approvers
USING
btree
(
user_id
);
CREATE
INDEX
index_audit_events_on_entity_id_and_entity_type_and_id_desc
ON
public
.
audit_events
USING
btree
(
entity_id
,
entity_type
,
id
DESC
);
CREATE
INDEX
index_audit_events_on_ruby_object_in_details
ON
public
.
audit_events
USING
btree
(
id
)
WHERE
(
details
~~
'%ruby/object%'
::
text
);
CREATE
INDEX
index_award_emoji_on_awardable_type_and_awardable_id
ON
public
.
award_emoji
USING
btree
(
awardable_type
,
awardable_id
);
...
...
@@ -10469,7 +10467,7 @@ CREATE UNIQUE INDEX index_oauth_applications_on_uid ON public.oauth_applications
CREATE
INDEX
index_oauth_openid_requests_on_access_grant_id
ON
public
.
oauth_openid_requests
USING
btree
(
access_grant_id
);
CREATE
INDEX
index_on_author_id_and_entity_id_and_entity_type_and_id_desc
ON
public
.
audit_events
USING
btree
(
author_id
,
entity_id
,
entity_type
,
id
DESC
);
CREATE
INDEX
index_on_author_id_and_entity_id_and_entity_type_and_id_desc
ON
public
.
audit_events
USING
btree
(
entity_id
,
entity_type
,
id
DESC
,
author_id
);
CREATE
UNIQUE
INDEX
index_on_deploy_keys_id_and_type_and_public
ON
public
.
keys
USING
btree
(
id
,
type
)
WHERE
(
public
=
true
);
...
...
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