I'm using alembic today, and I found a problem, if I changed the
column, it'll automatically create add and drop statment, just like
this:

    op.add_column('bas_grp_user', sa.Column('username', sa.Integer(),
nullable=False))
    op.drop_column('bas_grp_user', u'USERNAME')

But when I ran the upgrade I got:

sqlalchemy.exc.OperationalError: (OperationalError) (1060, "Duplicate
column name 'username'") 'ALTER TABLE bas_grp_user ADD COLUMN username
INTEGER NOT NULL' ()

so the problem is that the table is already exists in my database, so
when it excute the first statement it'll be fail. So I think drop
should be put in front of add.

-- 
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
UliWeb <<simple web framework>>: http://code.google.com/p/uliweb/
My Blog: http://hi.baidu.com/limodou

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to