Daniel Karzel
3 years ago
committed by
GitHub
1 changed files with 18 additions and 0 deletions
@ -0,0 +1,18 @@ |
|||
#!/bin/bash |
|||
|
|||
DAEMON_DIR=daemon |
|||
TEMPDB=tempdb |
|||
|
|||
# make sure to fail early in case something goes wrong |
|||
set -e |
|||
|
|||
# create temporary DB |
|||
DATABASE_URL=sqlite:$TEMPDB cargo sqlx database create |
|||
# make sure we remove the tempdb when exiting even if one of the following commands fails |
|||
trap 'rm -f $TEMPDB' EXIT |
|||
|
|||
# run the migration scripts to create the tables |
|||
DATABASE_URL=sqlite:$TEMPDB cargo sqlx migrate run |
|||
|
|||
# prepare the sqlx-data.json rust mappings |
|||
DATABASE_URL=sqlite:./$DAEMON_DIR/$TEMPDB cargo sqlx prepare -- --bin taker |
Loading…
Reference in new issue