To run from command-line:
cd backend
python app.py
Or to run locally with Heroku (not recommended):
heroku local web
pytest
Or to run a specific test:
pytest tests/test_database.py
-
Add class to models.py file (add tablename, columns, relationships)
-
Create .env file
cd backend
echo DATABASE_URL='"postgresql://localhost/brasa_pre5"' > .env
- Create migration by initialising the migrations directory once:
cd backend
python backend/manage.py db migrate -m "created initial tables"
If any db operations need to be added, add manually to the .py file created inside the migrations folder.
The database in Heroku will execute the upgrade script when deploying upon release of a new version. If running locally, run:
python backend/manage.py db upgrade
This will create tables and/or upgrade columns in the Postgres DB.
git push heroku master
TBD