July 2016
Beginner to intermediate
462 pages
9h 14m
English
If we use an object-relational mapper (ORM), such as SQLAlchemy, we map classes to tables and class attributes to table columns. Often, due to new business requirements, we need to add a table column and corresponding class attribute. We will probably need to populate the column immediately after adding it.
If we deal with a production database, then probably you do not have direct access. Luckily, we can generate SQL with Alembic, which a database administrator can review.
Refer to the Setting up database migration scripts recipe.
Alembic has its own versioning system, which requires extra tables. It also creates a versions directory under the alembic directory with generated Python ...