Alembic 0.7.4, mysql, MacOS X Last time I needed to add eight columns to a 10 million-row table using alembic migration, it took about 17 hours because each add_column was executed individually. With mysql, each individual ALTER TABLE command results in a full copy of the entire table. So, in my case, that was 8 whopping implicit full table copy operations (one per added column) that took 17 hours to complete :(
So, I was excited when I noticed the new context manager op.batch_alter_table, thinking that it will do the right thing with mysql, namely group all the column operations inside a single generated ALTER TABLE statement (allowed by mysql), and thus hoping to reduce my next set of column migrations to a single ALTER TABLE statement. So, I upgraded to Alembic 0.7.4 and used `op.batch_alter_table(...) as batch_op:` context manager and nested my column changes inside this context as `batch_op.add_column(...)`, etc. Disappointingly, op.batch_alter_table generated a bunch of *individual* ALTER TABLE statements for this table, instead of a single ALTER TABLE with multiple column operations in it. Am I doing something wrong? What's the right way to cause alembic to generate a single mysql ALTER TABLE statement with *multiple* column operations in it? Thank you, Vitaly -- You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy-alembic+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.