title: sqlalchemy error: object() takes no parameters error after dropping column from db model.py
body: <p>I get the following error <code>typeerror: object() takes no parameters</code> on a mysql command which doesn't make sense to me. The error is due to  dropping the username column from my models.py which I no longer require</p>
  
  <p><a href="https://i.stack.imgur.com/PpPms.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PpPms.png" alt="enter image description here"></a></p>
  
  <p>Below is the user model definition in my models.py file, I want to drop the username column and get the above error when I remove it from the model</p>
  
  <pre><code>class User(db.Model):
     __tablename__ = 'user'
     id = db.Column(db.Integer, primary_key=True)
     username = db.Column(db.String(32), index=True, unique=True)
     firstname = db.Column(db.String(128))
     lastname = db.Column(db.String(128))
     email = db.Column(db.String(120), index=True, unique=True)
  </code></pre>
  
  <p>Below is my db_migrate.py file which I used to update the db. I got this from  <a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iv-database" rel="nofollow noreferrer">Miguel's database tutorial</a></p>
  
  <pre><code>#!flask/bin/python
  import types
  from migrate.versioning import api
  from app import db
  from config import SQLALCHEMY_DATABASE_URI
  from config import SQLALCHEMY_MIGRATE_REPO
  v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
  migration = SQLALCHEMY_MIGRATE_REPO + ('/versions/%03d_migration.py' % (v+1))
  tmp_module = types.ModuleType('old_model')
  old_model = api.create_model(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
  exec(old_model, tmp_module.__dict__)
  script = api.make_update_script_for_model(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO, tmp_module.meta, db.metadata)
  open(migration, "wt").write(script)
  api.upgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
  v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
  print('New migration saved as ' + migration)
  print('Current database version: ' + str(v))
  </code></pre>
  
  <p>This is the 005_migration.py file</p>
  
  <pre><code>from sqlalchemy import *
  from migrate import *
  
  
  from migrate.changeset import schema
  pre_meta = MetaData()
  post_meta = MetaData()
  user = Table('user', pre_meta,
      Column('id', INTEGER(display_width=11), primary_key=True, nullable=False),
      Column('username', VARCHAR(length=32)),
      Column('email', VARCHAR(length=120)),
      Column('password_hash', VARCHAR(length=128)),
      Column('firstname', VARCHAR(length=128)),
      Column('lastname', VARCHAR(length=128)),
  )
  
  
  def upgrade(migrate_engine):
      # Upgrade operations go here. Don't create your own engine; bind
      # migrate_engine to your metadata
      pre_meta.bind = migrate_engine
      post_meta.bind = migrate_engine
      pre_meta.tables['user'].columns['username'].drop()
  
  
  def downgrade(migrate_engine):
      # Operations to reverse the above upgrade go here.
      pre_meta.bind = migrate_engine
      post_meta.bind = migrate_engine
      pre_meta.tables['user'].columns['username'].create()
  </code></pre>