diff --git a/dev.sh b/dev.sh index d0c6474..ed00167 100755 --- a/dev.sh +++ b/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