Fix keyword primary_key is not primary
Add missing import on sqlalchemy.orm for relation
Adjust the SQL script to update the current model to the new schema