Ok, got it!
Thanks for the help

def upgrade(migrate_engine):
    metadata.bind = migrate_engine
    yeshivotTable = Table('yeshivot', metadata, autoload=True)
    organ_id = Column('organ_id',Integer, ForeignKey('organs.id', 
name='fk_yeshivot_organ_id'))
    organ_id.create(yeshivotTable)


def downgrade(migrate_engine):
    metadata.bind = migrate_engine
    yeshivotTable = Table('yeshivot', metadata, autoload=True)
    
*cons = 
ForeignKeyConstraint([yeshivotTable.c.organ_id],[Organ.__table__.c.id],name='fk_yeshivot_organ_id')
    
cons.drop()*
*    yeshivotTable.c.organ_id.drop()*


The trick was createing a *ForeignKeyConstraint, *and using the name i gave 
my ForeignKey. i tryed that before, but now that i had a specfic name, i 
was able to drop it. after dropping the *ForeignKeyConstraint  *i also 
needed to drop the column (organ_id) from the table too.

Again, thanks for the help,
and reading the docs here - 
https://sqlalchemy-migrate.readthedocs.org/en/v0.7.1/changeset.html

-- 
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.

Reply via email to