Closed cafca closed 1 year ago
The plan is as follows:
@ciex @cartisan I need help with with actually creating my models into the database. I somehow managed that the python console recognizes reflection as module but i cannot import my models in order to test the csv thing because the models are unknown, which makes me believe that they arent yet created in the db, and because of Leons migration thing I did not want to destroy everything by try and error of commands for table creation from flask alchemy.
Do you get Import errors? If that is the case, it is a problem with your module not being on the Python path or not being imported the right way (relative imports). This is something I experience frequently. How so you cope with them @ciex ? If your model would be missing in the db, SQLAlchemy would throw you an appropriate message.
However, since you didn't run any migrations I assume it is ALSO the case, that the models are missing in the db. You can use Flask-migrate to create them: python manager.py db migrate
. This will create a migration file in the migrations dir. It does some autodetection of model changes, but can't detect everything. So you should check it out and edit it according to your needs. python manager.py db upgrade
applies the migration.