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
8c5e4a81
Commit
8c5e4a81
authored
13 years ago
by
Andreas Kusalananda Kähäri
Browse files
Options
Downloads
Patches
Plain Diff
When applying old patches, do not apply the 'a' patches that set
schema_version.
parent
14a86999
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/schema_patcher.pl
+21
-10
21 additions, 10 deletions
misc-scripts/schema_patcher.pl
with
21 additions
and
10 deletions
misc-scripts/schema_patcher.pl
+
21
−
10
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
();
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