Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
8c5e4a81
Commit
8c5e4a81
authored
Nov 21, 2011
by
Andreas Kusalananda Kähäri
Browse files
When applying old patches, do not apply the 'a' patches that set
schema_version.
parent
14a86999
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
misc-scripts/schema_patcher.pl
misc-scripts/schema_patcher.pl
+21
-10
No files found.
misc-scripts/schema_patcher.pl
View file @
8c5e4a81
...
...
@@ -64,7 +64,7 @@ Usage:
--fix also go through all old patches to find any missing
patch (patching starts at release equal to the
oldest patch in the database)
oldest patch in the database)
>>USE WITH CAUTION<<
--help display this text
--about display further information
...
...
@@ -149,10 +149,12 @@ sub about {
-s homo_sapiens -r 66 -d 'my_%'
A genebuilder makes sure that all patches up to and including
those for release 66 are included in her database:
those for release 66 are included in her database, without
actually applying any patch (any missing patches needs to be
manually checked!):
$0 -h host -u user -p password \\
-r 66 -d my_database --fix
-r 66 -d my_database --fix
--dryrun
ABOUT_END
}
## end sub about
...
...
@@ -422,22 +424,29 @@ while ( $sth->fetch() ) {
}
}
else
{
if
(
!
$opt_dryrun
)
{
printf
(
"
Will apply patch '%s' (%s)
\n
",
$patch
,
if
(
$r
<
$opt_release
&&
$patch
=~
/a\.sql$/
)
{
# Skip old patches that sets schema_version.
printf
(
"
Skipping 'a' patch (%s)
"
.
"
that would set old schema_version!
\n
",
$schema_type
);
push
(
@apply_these
,
$entry
);
}
else
{
printf
(
"
Would apply patch '%s' (%s)
\n
",
$patch
,
$schema_type
);
if
(
!
$opt_dryrun
)
{
printf
(
"
Will apply patch '%s' (%s)
\n
",
$patch
,
$schema_type
);
push
(
@apply_these
,
$entry
);
}
else
{
printf
(
"
Would apply patch '%s' (%s)
\n
",
$patch
,
$schema_type
);
}
}
}
}
## end foreach my $entry ( sort { ...})
}
## end for ( my $r = $start_version...)
if
(
$opt_dryrun
)
{
next
}
if
(
!
@apply_these
)
{
next
}
if
(
$opt_dryrun
||
!
@apply_these
)
{
print
("
\n
");
next
}
local
$|
=
1
;
print
("
Proceed with applying these patches? (y/N):
");
...
...
@@ -478,6 +487,8 @@ while ( $sth->fetch() ) {
}
## end foreach my $entry (@apply_these)
}
## end if ( lc($yesno) =~ /^y(?:es)?$/)
print
("
\n
");
}
## end while ( $sth->fetch() )
$dbh
->
disconnect
();
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