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
1e4c6529
Commit
1e4c6529
authored
Mar 03, 2022
by
Simon Tomlinson
Committed by
Bob Van Landuyt
Mar 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rerun ConvertStringifiedRawMetadataHashToJson inline
Changelog: other
parent
ee1afaf1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
db/post_migrate/20220215190020_rerun_convert_stringified_raw_metadata_hash_to_json.rb
...20_rerun_convert_stringified_raw_metadata_hash_to_json.rb
+27
-0
db/schema_migrations/20220215190020
db/schema_migrations/20220215190020
+1
-0
lib/gitlab/background_migration/fix_vulnerability_occurrences_with_hashes_as_raw_metadata.rb
..._vulnerability_occurrences_with_hashes_as_raw_metadata.rb
+1
-1
No files found.
db/post_migrate/20220215190020_rerun_convert_stringified_raw_metadata_hash_to_json.rb
0 → 100644
View file @
1e4c6529
# frozen_string_literal: true
class
RerunConvertStringifiedRawMetadataHashToJson
<
Gitlab
::
Database
::
Migration
[
1.0
]
MIGRATION_CLASS
=
Gitlab
::
BackgroundMigration
::
FixVulnerabilityOccurrencesWithHashesAsRawMetadata
MODEL_CLASS
=
MIGRATION_CLASS
::
Finding
DELAY_INTERVAL
=
2
.
minutes
BATCH_SIZE
=
500
disable_ddl_transaction!
def
up
queue_background_migration_jobs_by_range_at_intervals
(
MODEL_CLASS
.
by_api_report_types
,
MIGRATION_CLASS
.
name
.
demodulize
,
DELAY_INTERVAL
,
batch_size:
BATCH_SIZE
,
track_jobs:
true
)
end
def
down
# no-op
# up fixes invalid data by updating columns in-place.
# It is a backwards-compatible change, and reversing it in a downgrade would not be desirable.
end
end
db/schema_migrations/20220215190020
0 → 100644
View file @
1e4c6529
aa92afc5f74f051132aeb73889d7360bbd6258b27c0aedb4fea6a44ccce597b3
\ No newline at end of file
lib/gitlab/background_migration/fix_vulnerability_occurrences_with_hashes_as_raw_metadata.rb
View file @
1e4c6529
...
...
@@ -59,7 +59,7 @@ module Gitlab
private
def
mark_job_as_succeeded
(
*
arguments
)
Gitlab
::
Database
::
BackgroundMigrationJob
.
mark_all_as_succeeded
(
::
Gitlab
::
Database
::
BackgroundMigrationJob
.
mark_all_as_succeeded
(
'FixVulnerabilityOccurrencesWithHashesAsRawMetadata'
,
arguments
)
...
...
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