|
1 | 1 | IMPORTANT: |
2 | 2 | Login/Admin related modules deliberately not implemented, and the blueprint can be modified for Flask-Login or Admin based fixtures. |
| 3 | +## Instructions |
| 4 | +* Run ```docker-compose up --build``` and navigate to ```http://localhost:8000``` in the browser to test it out. |
3 | 5 |
|
4 | | -Run ```docker-compose up --build``` and navigate to ```http://localhost:5000``` in the browser to test it out. |
| 6 | +* To Initialize alembic run ```sudo docker-compose exec --user "$(id -u):$(id -g)" website alembic init alembic``` |
5 | 7 |
|
6 | | -Initialize alembic |
7 | | -```docker-compose exec --user "$(id -u):$(id -g)" website alembic init alembic``` |
| 8 | +* In alembic.ini change ```script_location``` to {flask_appname}/migrations comment out sqlalchemy.url(default is 'blogexample') |
8 | 9 |
|
9 | | -In alembic.ini |
10 | | -change ```script_location``` to {flask_appname}/migrations |
11 | | -comment out sqlalchemy.url |
12 | | - |
13 | | -In env.py |
14 | | -import os, sys, and (create_app and db(from app.py)) |
| 10 | +* In env.py import os, sys, and (create_app and db(from app.py)) |
15 | 11 | set up sqlalchemy url here |
16 | 12 |
|
17 | | -Build a model (Posts, Tags, Comments) |
18 | | - |
| 13 | +## *Optional* |
19 | 14 |
|
20 | | -autogenerate a migration |
21 | | -```docker-compose exec --user "$(id -u):$(id -g)" website alembic revision --autogenerate -m "create foo table"``` |
| 15 | + * Build a model (Posts, Tags, Comments) |
| 16 | + * After adding the model, autogenerate a migration ```sudo docker-compose exec --user "$(id -u):$(id -g)" website alembic revision --autogenerate -m "create foo table"``` |
22 | 17 |
|
23 | | -Get to alembic head after autogenerating a revision |
24 | | -```docker-compose exec website alembic upgrade head``` |
| 18 | +Finally, Get to alembic head after autogenerating a revision or to create db ```sudo docker-compose exec website alembic upgrade head``` |
0 commit comments