On 09/07/2016 10:18 AM, Chris Withers wrote:
Hi All, I have a migration which adds a column to a table where the added column forms part of the primary key.
woe be unto you.... :)
As a result, I need to alter the primary key of the table. Autogenerate doesn't appear to spot this, so what do I need to write manually to get this to work?
you need to drop the PK constraint and then re-create it. Which means for the "drop" you need to know its name for drop_constraint("my_pk_name").
Here's the create: http://alembic.zzzcomputing.com/en/latest/ops.html#alembic.operations.Operations.create_primary_key
cheers, Chris
-- 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.