Bulk creation of columns

10 views
Skip to first unread message

pravin battula

unread,
Sep 21, 2011, 7:54:04 AM9/21/11
to sqlal...@googlegroups.com
Hi, 

How can i create columns in bulk using create_column  method? 

I tried as below,. 

    migrate_engine = create_engine('mysql://root:root@localhost/ 
payroll', echo=False) 
    metadata = MetaData(bind = migrate_engine) 
    metadata.reflect(bind = migrate_engine, schema = 'payroll') 

    tableObj = metadata.tables.get('test.salary') 

    colList = 
[Column('description',String(100)),Column('information',String(50))] 

    tableObj.append_column(*colList) 
    tableObj.create_column(*colList) 

getting an error as TypeError:create() got multiple values for keyword argument 'table'

Please do the needful. 

King Simon-NFHD78

unread,
Sep 22, 2011, 5:35:53 AM9/22/11
to sqlal...@googlegroups.com

create_column isn't an SQLAlchemy method as far as I know. Are you using
something like sqlalchemy-migrate
(http://code.google.com/p/sqlalchemy-migrate/)?

If so, you'll probably get more help on their mailing list.

Hope that helps,

Simon

Reply all
Reply to author
Forward
0 new messages