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
c11b9922
Commit
c11b9922
authored
13 years ago
by
Monika Komorowska
Browse files
Options
Downloads
Patches
Plain Diff
Delete entries from db for releases older than previous release.
parent
3e64940f
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/update_database_list.pl
+19
-7
19 additions, 7 deletions
...ripts/production_database/scripts/update_database_list.pl
with
19 additions
and
7 deletions
misc-scripts/production_database/scripts/update_database_list.pl
+
19
−
7
View file @
c11b9922
...
...
@@ -64,7 +64,8 @@ About:
Given at least a release number, this program will discover new
databases on the staging servers and add them to the list of databases
in the production database on the master server.
in the production database on the master server. It will also delete any old
databases from the list up to the previous realease.
The default options are set to minimize hassle for the Ensembl release
coordinator who needs to run this script during the Ensembl production
...
...
@@ -91,7 +92,7 @@ my ( $dbuser, $dbpass ) = ( 'ensro', undef );
my
$opt_help
=
0
;
my
$opt_about
=
0
;
if
(
!
GetOptions
(
'
release|r=
s
'
=>
\
$release
,
if
(
!
GetOptions
(
'
release|r=
i
'
=>
\
$release
,
'
master|m=s
'
=>
\
$master
,
'
mport|mP=i
'
=>
\
$mport
,
'
server|s=s@
'
=>
\
@servers
,
...
...
@@ -125,12 +126,26 @@ my %databases;
my
%existing_databases
;
my
%found_databases
;
{
my
$dsn
=
sprintf
(
'
DBI:mysql:host=%s;port=%d;database=%s
',
$master
,
$mport
,
'
ensembl_production
'
);
my
$dbh
=
DBI
->
connect
(
$dsn
,
$dbuser
,
$dbpass
,
my
$dbh
=
DBI
->
connect
(
$dsn
,
$db
w
user
,
$db
w
pass
,
{
'
PrintError
'
=>
1
,
'
RaiseError
'
=>
1
}
);
{
my
$previous_release
=
$release
-
1
;
print
"
Delete entries from db and db_list for releases older than
"
.
$previous_release
.
"
? (y/n)
\n
";
my
$response
=
<>
;
chomp
$response
;
if
(
$response
eq
'
y
'){
$dbh
->
do
("
DELETE FROM db WHERE db_release <
$previous_release
");
}
}
{
my
$statement
=
'
SELECT species_id, web_name, db_name
'
...
...
@@ -230,6 +245,7 @@ foreach my $server (@servers) {
if
(
scalar
(
keys
(
%databases
)
)
==
0
)
{
printf
(
"
Did not find any new databases for release %s
\n
",
$release
);
}
else
{
my
$dsn
=
sprintf
(
'
DBI:mysql:host=%s;port=%d;database=%s
',
$master
,
$mport
,
'
ensembl_production
'
);
my
$dbh
=
DBI
->
connect
(
$dsn
,
$dbwuser
,
$dbwpass
,
...
...
@@ -275,8 +291,4 @@ if ( scalar( keys(%existing_databases) ) !=
printf
(
"
\t
%s
\n
",
$db_name
);
}
}
print
("
\n
");
print
(
"
If these are really properly gone,
"
.
"
please remove the corresponding
\n
"
.
"
entries from the 'db' table of the production database.
\n
"
);
}
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