Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
6bfd5464
Commit
6bfd5464
authored
12 years ago
by
Andy Yates
Browse files
Options
Downloads
Patches
Plain Diff
Adding an option to remove meta keys which are deprecated
parent
1653f6b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc-scripts/production_database/scripts/populate_species_meta.pl
+32
-1
32 additions, 1 deletion
...ipts/production_database/scripts/populate_species_meta.pl
with
32 additions
and
1 deletion
misc-scripts/production_database/scripts/populate_species_meta.pl
+
32
−
1
View file @
6bfd5464
...
...
@@ -19,6 +19,7 @@ sub run {
$self
->
v
(
'
Processing %s
',
$db
);
$self
->
_backup
(
$db
);
$self
->
_meta
(
$db
);
$self
->
_remove_deprecated
(
$db
);
$self
->
v
('
Done
');
}
return
;
...
...
@@ -43,7 +44,9 @@ sub args {
# User database location (default values):
port
=>
3306
,
backup
=>
1
#default backups on
backup
=>
1
,
#default backups on
removedeprecated
=>
0
,
};
my
@cmd_opts
=
qw/
...
...
@@ -65,6 +68,7 @@ sub args {
pattern=s
verbose|v!
backup
removedeprecated!
help
man
/
;
...
...
@@ -232,6 +236,28 @@ sub _backup {
return
;
}
sub
_remove_deprecated
{
my
(
$self
,
$db
)
=
@_
;
if
(
!
$self
->
{
opts
}
->
{
removedeprecated
})
{
$self
->
v
('
Not removing deprecated meta keys
');
return
;
}
my
$dba
=
$self
->
_core_dba
(
$db
);
my
$mc
=
$dba
->
get_MetaContainer
();
$self
->
v
('
Removing deprecated meta keys
');
my
@deprecated_keys
=
qw/species.ensembl_common_name species.ensembl_alias_name/
;
foreach
my
$key
(
@deprecated_keys
)
{
$self
->
v
('
Deleting key "%s"
',
$key
);
$mc
->
delete_key
(
$key
);
}
$self
->
v
('
Finished removing deprecated meta keys
');
return
;
}
sub
_db_to_taxon
{
my
(
$self
,
$db
)
=
@_
;
...
...
@@ -416,6 +442,11 @@ Database name to search for. Can be a SQL like statement
If specified we will avoid performing backup of the meta table before
a run of the script.
=item B<--removedeprecated>
Deletes any key from the DB which is deemed to be deprecated. A temporary
option until we finish working with the latest set of meta key changes.
=item B<--verbose>
Make the script chatty
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment