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
879b416a
Commit
879b416a
authored
Dec 07, 2020
by
Mike Kozono
Committed by
Gabriel Mazetto
Jan 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add verification indexes to package file registry
parent
ce15695c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
ee/db/geo/migrate/20201208031224_add_verification_indexes_to_package_file_registry.rb
...1224_add_verification_indexes_to_package_file_registry.rb
+24
-0
ee/db/geo/schema.rb
ee/db/geo/schema.rb
+4
-1
No files found.
ee/db/geo/migrate/20201208031224_add_verification_indexes_to_package_file_registry.rb
0 → 100644
View file @
879b416a
# frozen_string_literal: true
class
AddVerificationIndexesToPackageFileRegistry
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
PENDING_VERIFICATION_INDEX_NAME
=
"package_file_registry_pending_verification"
FAILED_VERIFICATION_INDEX_NAME
=
"package_file_registry_failed_verification"
NEEDS_VERIFICATION_INDEX_NAME
=
"package_file_registry_needs_verification"
disable_ddl_transaction!
def
up
add_concurrent_index
:package_file_registry
,
:verified_at
,
where:
"(state = 2 AND verification_state = 0)"
,
order:
{
verified_at:
'ASC NULLS FIRST'
},
name:
PENDING_VERIFICATION_INDEX_NAME
add_concurrent_index
:package_file_registry
,
:verification_retry_at
,
where:
"(state = 2 AND verification_state = 3)"
,
order:
{
verification_retry_at:
'ASC NULLS FIRST'
},
name:
FAILED_VERIFICATION_INDEX_NAME
add_concurrent_index
:package_file_registry
,
:verification_state
,
where:
"(state = 2 AND (verification_state = 0 OR verification_state = 3))"
,
name:
NEEDS_VERIFICATION_INDEX_NAME
end
def
down
remove_concurrent_index_by_name
:package_file_registry
,
PENDING_VERIFICATION_INDEX_NAME
remove_concurrent_index_by_name
:package_file_registry
,
FAILED_VERIFICATION_INDEX_NAME
remove_concurrent_index_by_name
:package_file_registry
,
NEEDS_VERIFICATION_INDEX_NAME
end
end
ee/db/geo/schema.rb
View file @
879b416a
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2020_12_08_0
2525
4
)
do
ActiveRecord
::
Schema
.
define
(
version:
2020_12_08_0
3122
4
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -124,6 +124,9 @@ ActiveRecord::Schema.define(version: 2020_12_08_025254) do
t
.
index
[
"package_file_id"
],
name:
"index_package_file_registry_on_repository_id"
t
.
index
[
"retry_at"
],
name:
"index_package_file_registry_on_retry_at"
t
.
index
[
"state"
],
name:
"index_package_file_registry_on_state"
t
.
index
[
"verification_retry_at"
],
name:
"package_file_registry_failed_verification"
,
order:
"NULLS FIRST"
,
where:
"((state = 2) AND (verification_state = 3))"
t
.
index
[
"verification_state"
],
name:
"package_file_registry_needs_verification"
,
where:
"((state = 2) AND ((verification_state = 0) OR (verification_state = 3)))"
t
.
index
[
"verified_at"
],
name:
"package_file_registry_pending_verification"
,
order:
"NULLS FIRST"
,
where:
"((state = 2) AND (verification_state = 0))"
end
create_table
"project_registry"
,
id: :serial
,
force: :cascade
do
|
t
|
...
...
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