Documentation for migrations

This commit is contained in:
Paul Bienkowski 2022-03-21 22:26:07 +01:00
parent 76270d199e
commit 157b970b29
3 changed files with 42 additions and 6 deletions

View file

@ -52,10 +52,18 @@ Please note that you will always need to install your own reverse proxy that
terminates TLS for you and handles certificates. We do not support TLS directly
in the application, instead, please use this prefered method.
Upgrading and migrating is descrube
### Migrating (Production)
Migrations are not implemented yet. Once we need them, we'll add them and
document the usage here.
Migrations are done with
[Alembic](https://alembic.sqlalchemy.org/en/latest/index.html), please refer to
its documentation for help. Most of the time, running this command will do all
the migrations you need:
```bash
docker-compose run --rm api alembic upgrade head
```
### Upgrading from v0.2 to v0.3
@ -165,8 +173,14 @@ testing.
### Migrating (Development)
Migrations are not implemented yet. Once we need them, we'll add them and
document the usage here.
Migrations are done with
[Alembic](https://alembic.sqlalchemy.org/en/latest/index.html), please refer to
its documentation for help. Most of the time, running this command will do all
the migrations you need:
```bash
docker-compose run --rm api alembic upgrade head
```
## Import OpenStreetMap data

View file

@ -2,8 +2,16 @@
This document describes the general steps to upgrade between major changes.
Simple migrations, e.g. for adding schema changes, are not documented
explicitly. Once we implement them, their usage will be described in the
[README](./README.md).
explicitly. Their general usage is described in the [README](./README.md) (for
development) and [deployment/README.md](deployment/README.md) (for production).
## 0.5.0
* **Prepare SQL Tiles**: required
* **OSM Import**: no
* **Migration**: required
* **Reimport tracks**: required
* **Config changes**: none
## 0.4.1

View file

@ -367,6 +367,20 @@ docker-compose up -d
Before updating make sure that you have properly backed-up your instance so you
can always roll back to a pre-update state.
#### Migrating
Migrations are done with
[Alembic](https://alembic.sqlalchemy.org/en/latest/index.html), please refer to
its documentation for help. Most of the time, running this command will do all
the migrations you need:
```bash
docker-compose run --rm portal alembic upgrade head
```
You are advised to create a backup (see below) before running a migration, and
to shut down the services before the migration and start them afterwards.
### Backups
To backup your instances private data you only need to backup the ``$ROOT`` folder.