On Jan 22, 2014, at 6:55 AM, [email protected] wrote: > Thanks for the help, I need a bit more > > I gave my ForeignKey a name, so far so good. > (I'm using MySQL btw) > > I cant seem to find how to delete that name/column or object > > In my Model: > organ_id = Column('organ_id',Integer, ForeignKey('organs.id', > name='fk_yeshivot_organ_id')) > > "fk_yeshivot_organ_id" is the name of my ForeignKey object, > > > I tryed, but this doesn't work: > > def downgrade(migrate_engine): > metadata.bind = migrate_engine > yeshivotTable = Table('yeshivot', metadata, autoload=True) > yeshivotTable.c.fk_yeshivot_organ_id.drop() > > I get AttribureError, beacuse yeshivotTable.c doesn't have > fk_yeshivot_organ_id, so where shoud it be, and how to drop it?
that would be op.drop_constraint(“fk_yeshivot_organ_id”, “yeshivot”, type_=“foreign key”) http://alembic.readthedocs.org/en/latest/ops.html#alembic.operations.Operations.drop_constraint > > > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/groups/opt_out.
signature.asc
Description: Message signed with OpenPGP using GPGMail
