Add a note about updating travelynx
This commit is contained in:
parent
216dd7c7ad
commit
8096c33c00
2 changed files with 31 additions and 1 deletions
22
README.md
22
README.md
|
@ -55,6 +55,28 @@ Please open an issue on <https://github.com/derf/travelynx/issues> or send a
|
|||
mail to derf+travelynx@finalrewind.org if there is anything missing or
|
||||
ambiguous in this setup manual.
|
||||
|
||||
Updating
|
||||
---
|
||||
|
||||
It is recommended to run travelynx directly from the git repository. When
|
||||
updating, the workflow depends on whether schema updates need to applied
|
||||
or not.
|
||||
|
||||
```
|
||||
git pull
|
||||
chmod -R a+rX . # only needed if travelynx is running under a different user
|
||||
if perl index.pl database has-current-schema; then
|
||||
systemctl reload travelynx
|
||||
else
|
||||
systemctl stop travelynx
|
||||
perl index.pl migrate
|
||||
systemctl start travelynx
|
||||
fi
|
||||
```
|
||||
|
||||
Note that this is subject to change -- the application may perform schema
|
||||
updates automatically in the future.
|
||||
|
||||
Usage
|
||||
---
|
||||
|
||||
|
|
|
@ -106,6 +106,14 @@ sub run {
|
|||
$dbh->commit;
|
||||
}
|
||||
}
|
||||
elsif ( $command eq 'has-current-schema' ) {
|
||||
if ( get_schema_version($dbh) == $#migrations ) {
|
||||
say "yes";
|
||||
}
|
||||
else {
|
||||
say "no";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$self->help;
|
||||
}
|
||||
|
@ -120,7 +128,7 @@ __END__
|
|||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
Usage: index.pl database <setup|migrate>
|
||||
Usage: index.pl database <setup|migrate|has-current-schema>
|
||||
|
||||
Upgrades the database layout to the latest schema.
|
||||
|
||||
|
|
Loading…
Reference in a new issue