Hassan Mohagheghian
Hassan Mohagheghian

Reputation: 51

how update database fields in orm+python when tables column is changed?

I use Sqlalchemy orm,python, python migrate for my project that is a project about Accounting. my issue is: for example in version 1 the fields of a tables has a 4 colomun. I release project and a person use this for her work. he input data to table. I work in project and release version 2 of project so that the has 5 fields. how to update the project to last version so that data in older table import to new table. merci.

Upvotes: 1

Views: 125

Answers (1)

javex
javex

Reputation: 7554

Use alembic. It provides you with the ability to do table migrations on software updates. Read the documentation on how to integrate it in your project.

Upvotes: 1

Related Questions