rest-apis-flask-python icon indicating copy to clipboard operation
rest-apis-flask-python copied to clipboard

ch11 step 1 render.com does not create the tables

Open teksaver opened this issue 1 year ago • 2 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

teksaver avatar Jun 03 '23 10:06 teksaver

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

teksaver avatar Jun 03 '23 11:06 teksaver

Proposed PR https://github.com/tecladocode/rest-apis-flask-python/pull/136

teksaver avatar Jun 03 '23 11:06 teksaver

Closing via #136

jslvtr avatar Apr 04 '24 12:04 jslvtr