Skip to content

Commit

Permalink
Add database migration to dev environment startup script
Browse files Browse the repository at this point in the history
  • Loading branch information
steventux committed Jan 22, 2025
1 parent f4884a5 commit 49cc82a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,14 @@
# Add the relevant package repository then run:
# sudo apt-get install azure-functions-core-tools-4

ENV_FILE=".env.local"

source ${ENV_FILE}
echo "Creating database ${DATABASE_NAME}..."
psql -U ${DATABASE_USER} -c "CREATE DATABASE ${DATABASE_NAME};"

echo "Migrating database to latest version..."
ENV_FILE=${ENV_FILE} alembic upgrade head

echo "Starting the API function app..."
cd src/notify && func start --verbose

0 comments on commit 49cc82a

Please sign in to comment.