class Hero(SQLModel, table=True):
id: int = Field(primary_key=True)
name: str
age: int = Field(default=None)
status:str
I created the table using SQLModel.metadata.create_all(engine), when I changed the type of status to str and run the create_all() method again the type of status did not change in the database. Is there any way to migrate the database like Django or flask-migrate?
The fastest way is to drop the table manually and reload the app.
But if you want a more automated and reliable solution check the following link:
https://github.com/tiangolo/sqlmodel/issues/85
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With