2016-08-07 02:57:44 +00:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
|
2016-08-07 03:59:51 +00:00
|
|
|
SCRIPT_PATH=$(cd "$(dirname "$0")" ; pwd -P)
|
2016-08-07 06:14:05 +00:00
|
|
|
DATABASE_URL=${SCRIPT_PATH}/db/db.sql
|
2016-08-07 02:57:44 +00:00
|
|
|
|
2016-09-30 22:39:55 +00:00
|
|
|
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
|
|
|
|
fi
|
2016-08-07 02:57:44 +00:00
|
|
|
|
|
|
|
# create db/db.sql
|
|
|
|
diesel migration --database-url=$DATABASE_URL run
|
2016-09-30 22:39:55 +00:00
|
|
|
popd $SCRIPT_PATH > /dev/null
|