forked from lavina/lavina
Add info on migrations
This commit is contained in:
parent
7e1c4fd939
commit
6f25ce0fd5
|
@ -67,3 +67,35 @@ Or you can build it and run manually:
|
||||||
|
|
||||||
cargo build --release
|
cargo build --release
|
||||||
./target/release/lavina --config config.toml
|
./target/release/lavina --config config.toml
|
||||||
|
|
||||||
|
|
||||||
|
## Migrations
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
Install sqlx-cli into ~/.local/bin:
|
||||||
|
|
||||||
|
cargo install --locked sqlx-cli
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
Migrations run on every application start. For manual run, use sqlx:
|
||||||
|
|
||||||
|
sqlx mig run \
|
||||||
|
--source ./crates/lavina-core/migrations/ \
|
||||||
|
--database-url sqlite://db.sqlite
|
||||||
|
|
||||||
|
To see current status:
|
||||||
|
|
||||||
|
sqlx mig info \
|
||||||
|
--source ./crates/lavina-core/migrations/ \
|
||||||
|
--database-url sqlite://db.sqlite
|
||||||
|
|
||||||
|
sqlx mig info outputs
|
||||||
|
|
||||||
|
0/installed first
|
||||||
|
1/installed msg author
|
||||||
|
2/installed created at for messages
|
||||||
|
3/installed dialogs
|
||||||
|
4/installed new challenges
|
||||||
|
5/pending message datetime
|
||||||
|
|
Loading…
Reference in New Issue