>
> So, create a Table, use that, make sure you’re sending the right kinds of 
> objects to bulk_insert(). 
>

Thank you very much for that very quick reply, this did the trick. The 
try/except blocks in my post above were just to show what I've tried so far.

I'll include my working code so that it may help someone else:

    conn = op.get_bind()

    metadata = sa.MetaData()

    dog_table = sa.Table('dog', metadata,
                           sa.Column('id', sa.INTEGER(), primary_key=True,
                                     autoincrement=True),
                           sa.Column('mammal_id', sa.INTEGER(), 
nullable=True),
                           sa.ForeignKeyConstraint(['mammal_id'], 
[Mammal.id],
                                                   
name='dog_mammal_id_fkey'),
                           sa.PrimaryKeyConstraint('id', name='dog_pkey'))

    dog_table.create(conn)

    new_dogs = reconstruct_dogs()

    op.bulk_insert(dog_table, new_dogs)


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

Reply via email to