0

The way I perform migration for a database is
1. run command alembic upgrade head to upgrade the local postgres to match database schema.
2. update the model to add new column (or index) to a table.
3. then run alembic revision --autogenerate -m "Message for the migration" to generate a new migration python file in migrations/migrate/versions folder.
4. then run almebic upgrade head again to apply the new change to Postgres.
5. confirm whether the column (or index) was generated.

Above flow works great for me, but I want to know how much time it took for the migration to complete.

1 Answers1

0

Timing isn't built into Alembic, however you can time any command on unix using the time command.

time alembic upgrade head

See also Windows equivalent

Gricey
  • 1,321
  • 1
  • 18
  • 38