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
0af25745
Commit
0af25745
authored
Dec 08, 2020
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Schedule background migration
Schedule artifact expiry backfill migration for execution.
parent
e8e21745
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
db/post_migrate/20201208175117_schedule_backfilling_artifact_expiry_migration.rb
...8175117_schedule_backfilling_artifact_expiry_migration.rb
+28
-0
db/schema_migrations/20201208175117
db/schema_migrations/20201208175117
+1
-0
db/structure.sql
db/structure.sql
+2
-0
No files found.
db/post_migrate/20201208175117_schedule_backfilling_artifact_expiry_migration.rb
0 → 100644
View file @
0af25745
# frozen_string_literal: true
class
ScheduleBackfillingArtifactExpiryMigration
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'expired_artifacts_temp_index'
INDEX_CONDITION
=
'expire_at IS NULL'
disable_ddl_transaction!
def
up
# Create temporary index for expired artifacts
# Needs to be removed in a later migration
add_concurrent_index
(
:ci_job_artifacts
,
:expire_at
,
where:
INDEX_CONDITION
,
name:
INDEX_NAME
)
queue_background_migration_jobs_by_range_at_intervals
(
::
Ci
::
JobArtifact
.
where
(
expire_at:
nil
),
::
Gitlab
::
BackgroundMigration
::
BackfillArtifactExpiryDate
,
2
.
minutes
,
batch_size:
100_000
)
end
def
down
# no-op
end
end
db/schema_migrations/20201208175117
0 → 100644
View file @
0af25745
68971e7f9a722e98d9e611f614b5465de83ff3d4dc8c7a8078ed1db8f21e6590
\ No newline at end of file
db/structure.sql
View file @
0af25745
...
...
@@ -20756,6 +20756,8 @@ CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_and_note_id_index ON epic_user
CREATE
UNIQUE
INDEX
epic_user_mentions_on_epic_id_index
ON
epic_user_mentions
USING
btree
(
epic_id
)
WHERE
(
note_id
IS
NULL
);
CREATE
INDEX
expired_artifacts_temp_index
ON
ci_job_artifacts
USING
btree
(
expire_at
)
WHERE
(
expire_at
IS
NULL
);
CREATE
INDEX
finding_links_on_vulnerability_occurrence_id
ON
vulnerability_finding_links
USING
btree
(
vulnerability_occurrence_id
);
CREATE
INDEX
idx_audit_events_on_entity_id_desc_author_id_created_at
ON
audit_events_archived
USING
btree
(
entity_id
,
entity_type
,
id
DESC
,
author_id
,
created_at
);
...
...
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