Add database helpers in dev.sh
This commit is contained in:
parent
3b397300bc
commit
d9d71c8ebd
17
dev.sh
17
dev.sh
@ -26,6 +26,12 @@ _usage() {
|
||||
echo " $prog front"
|
||||
echo " Install the JS packages and run the frontend"
|
||||
echo ""
|
||||
echo " $prog migrate [args]"
|
||||
echo " Runs the migrate command with the given parameters"
|
||||
echo ""
|
||||
echo " $prog db-shell"
|
||||
echo " Get a psql shell on the database"
|
||||
echo ""
|
||||
echo " $prog db-init"
|
||||
echo " Refresh the informations (imdb / movies / shows) needed"
|
||||
echo " before the first run"
|
||||
@ -114,6 +120,17 @@ canape_logout() {
|
||||
}
|
||||
|
||||
case $1 in
|
||||
migrate)
|
||||
shift
|
||||
_migrate -path "$MIGRATION_SCHEMA" "$@"
|
||||
;;
|
||||
db-shell)
|
||||
docker run -it --rm \
|
||||
-e PGPASSWORD="$DB_PASS" \
|
||||
--link canape_postgresql_dev:postgres \
|
||||
postgres:9.5 \
|
||||
psql -h postgres -U "$DB_USER" -d "$DB_DATABASE"
|
||||
;;
|
||||
back)
|
||||
# Apply the migrations
|
||||
_migrate -path "$MIGRATION_SCHEMA" up
|
||||
|
Loading…
x
Reference in New Issue
Block a user