[sqlalchemy] translating many-to-many relationship from CSV to database?

2014-10-12 Thread James Hartley
I have a CSV file with lots of redundant data which models many-to-many relationships. I'm needing to scrub the data as it is inserted into the database littered with unique constraints. Is there a way to insert the data once without querying for each object before inserting? I'm sure this is a

[sqlalchemy] how to add an order column to an existing table

2014-10-12 Thread Ofir Herzas
I have the following table: my_table = sa.sql.table('my_table', sa.Column('id', sa.BigInteger), sa.Column('employee_id', sa.BigInteger)) and I want to add a 'rank' column using alembic. The addition itself is pretty straight forward using add_column but I also need to populate that co