I have a local DB set up for which I create object-relational mapping with SQLAlchemy objects.
Everything was fine until I changed the schema of the DB - including adding a new column to one of the tables. Now I keep seeing:
sqlalchemy.exc.NoReferencedColumnError: Could not initialize target column for ForeignKey 'ModelFit.id' on table 'ModelPrice': table 'ModelFit' has no column named 'id'
where 'id' is the SQLALchemy Column object of ModelFit table's "Id" column.
Straight SQL queries on the new DB execute fine, the only problem is initializing this mapping.
I saw a similar question from someone saying they figured it out by "removing the .db file from the project and ran it again", but I don't have any such file. I don't even use flask or anything to create the DB, did it straight in local DB using SQL.
Any help or insight on what is happening here? Or would more info be helpful?