mirror of
https://github.com/rwf2/Rocket.git
synced 2024-12-27 21:02:41 +00:00
17 lines
433 B
Bash
Executable File
17 lines
433 B
Bash
Executable File
#! /usr/bin/env bash
|
|
|
|
SCRIPT_PATH=$(cd "$(dirname "$0")" ; pwd -P)
|
|
DATABASE_URL=${SCRIPT_PATH}/db/db.sql
|
|
|
|
pushd $SCRIPT_PATH > /dev/null
|
|
# install the diesel CLI tools if they're not installed
|
|
if ! command -v diesel >/dev/null 2>&1; then
|
|
cargo install diesel_cli > /dev/null
|
|
fi
|
|
|
|
# create db/db.sql
|
|
diesel migration --database-url=$DATABASE_URL run > /dev/null
|
|
popd > /dev/null
|
|
|
|
echo "export DATABASE_URL=$DATABASE_URL"
|