title: How to write alter column name migrations with sqlalchemy-migrate?
body: <p>I'm trying to alter a column name. First attempt was with this script:</p>
  
  <pre><code>meta = MetaData()
  
  users = Table('users', meta,
      Column('id', Integer, primary_key=True),
      Column('name', String(50), unique=True),
      Column('email', String(120), unique=True)
      )
  
  def upgrade(migrate_engine):
      meta.bind = migrate_engine
      users.c.id.alter(name='id')
  
  def downgrade(migrate_engine):
      meta.bind = migrate_engine
      users.c.id.alter(name='user_id')
  </code></pre>
  
  <p>Running <code>migrate.py test</code> on my dev database (sqlite) works and so does upgrading and downgrading. But when deploying it to my test environment on Heroku (where PostgreSQL 8.3 is used) I get a trace when I try to upgrade. Gist is this message:</p>
  
  <pre><code>sqlalchemy.exc.ProgrammingError: (ProgrammingError) column "id" does not exist 
  </code></pre>
  
  <p>I then tried to use <code>users.c.user_id</code>in the upgrade method. That fails in both environments.:</p>
  
  <pre><code>AttributeError: user_id
  </code></pre>
  
  <p>The workaround I'm using now is this script:</p>
  
  <pre><code>meta_old = MetaData()
  meta_new = MetaData()
  
  users_old = Table('users', meta_old,
      Column('user_id', Integer, primary_key=True),
      Column('name', String(50), unique=True),
      Column('email', String(120), unique=True)
      )
  
  users_new = Table('users', meta_new,
      Column('id', Integer, primary_key=True),
      Column('name', String(50), unique=True),
      Column('email', String(120), unique=True)
      )
  
  def upgrade(migrate_engine):
      meta_old.bind = migrate_engine
      users_old.c.user_id.alter(name='id')
  
  def downgrade(migrate_engine):
      meta_new.bind = migrate_engine
      users_new.c.id.alter(name='user_id')
  </code></pre>
  
  <p>It's already recommended practice to copy-paste the model to the sqlalchemy-migrate scripts. But this extra duplications gets a bit too much for me. Anyone knows how this should be done. Assuming it's a bug, I'd like suggestions on how to DRY up the workaround some.</p>