tecladocode / rest-apis-flask-python

Projects and e-book for our course, REST APIs with Flask and Python

Home Page:https://rest-apis-flask.teclado.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ch11 step 1 render.com does not create the tables

teksaver opened this issue · comments

Running the app on render.com triggers the following

OperationalError
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: stores
[SQL: SELECT stores.id AS stores_id, stores.name AS stores_name
FROM stores]
(Background on this error at: https://sqlalche.me/e/20/e3q8)

Seems like the data.db is not created when running the app

Same behavior on local app: flask db upgrade is necessary to trigger the creation. However, since data.db is on the gitignore file it does not get sent to render.com

Possible fix is

RUN flask db upgrade

in the Docker file

Proposed PR #136