You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
523 B
18 lines
523 B
#!/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
|
|
|