Code review comment for lp:~raj-abhilash1/mailman/alembic-fix

Revision history for this message
Abhilash Raj (raj-abhilash1) wrote :

On Monday 12 January 2015 06:11 AM, Barry Warsaw wrote:
> Thanks for working on this. I think my problem is more basic. How do I run this - or maybe, *do* I even need to run this? For example, how would I create a migration for the pre-py3 branch merge to the current trunk, where a few columns changed from LargeBinary to Unicode?

The basic command to generate migrations automatically would be like this:

   `alembic -c src/mailman/config/alembic.cfg revision --autogenerate`

What alembic does is compares the current state of database schema and
models, so in order to automatically generate the migrations you need to
have the database in the older state. Then the migrations would be
applied automatically when the mailman is started next. So when someone
updates the mailman, the database schema would be upgraded in the first
run automatically. In case you don't have the database in the old state
you generate an empty revision( just remove the --autogenerate flag in
the above command) and add the migrations yourself.

> Could you add some documentation on what needs to be done to make the migration work, say in src/mailman/docs/DATABASE.rst? Or is everything so automatic that I don't need to do anything when the database model changes? (I doubt that. :)

I will add what I wrote above in the documentation as well.

--
thanks,
Abhilash Raj

« Back to merge proposal