title: AttributeError: 'int' object has no attribute '_compiler_dispatch'
body: <p>I am using the <code>flask-sqlalchemy</code> extension with <code>alembic</code> for migrations. When I try to add a new migration file and upgrade the schema to the latest one, I get the following error:</p>
  
  <pre><code>AttributeError: 'int' object has no attribute '_compiler_dispatch'
  </code></pre>
  
  <p>The content of the migration file:</p>
  
  <pre><code>revision = 'ec2c2d40eb1'
  down_revision = '28dda873b826'
  
  from alembic import op
  import sqlalchemy as sa
  
  
  def upgrade():
      op.alter_column(
          'users',
          'wiki_permission',
          new_column_name='wiki_group',
          nullable=False,
          existing_nullable=False,
          type_=sa.Integer(),
          existing_type=sa.Integer(),
          server_default=1,
          existing_server_default=1          # Line of error - 27
      )   
  
  
  def downgrade():
      op.alter_column(
          'users',
          'wiki_group',
          new_column_name='wiki_permission',
          nullable=False,
          existing_nullable=False,
          type_=sa.Integer(),
          existing_type=sa.Integer(),
          server_default=1,
          existing_server_default=1
      )
  </code></pre>
  
  <p>Thanks for taking time to help me.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>The complete error message :</p>
  
  <pre><code>INFO  [alembic.migration] Context impl MySQLImpl.
  INFO  [alembic.migration] Will assume non-transactional DDL.
  INFO  [alembic.migration] Running upgrade 28dda873b826 -&gt; ec2c2d40eb1, users change column wiki_permission to wiki_group
  Traceback (most recent call last):
    File "/home/kevin/Code/python/flask/terminus/venv/bin/alembic", line 9, in &lt;module&gt;
      load_entry_point('alembic==0.6.5', 'console_scripts', 'alembic')()
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/config.py", line 298, in main
      CommandLine(prog=prog).main(argv=argv)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/config.py", line 293, in main
      self.run_cmd(cfg, options)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/config.py", line 279, in run_cmd
      **dict((k, getattr(options, k)) for k in kwarg)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/command.py", line 125, in upgrade
      script.run_env()
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/script.py", line 203, in run_env
      util.load_python_file(self.dir, 'env.py')
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/util.py", line 212, in load_python_file
      module = load_module_py(module_id, path)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/compat.py", line 58, in load_module_py
      mod = imp.load_source(module_id, path, fp)
    File "alembic/env.py", line 77, in &lt;module&gt;
      run_migrations_online()
    File "alembic/env.py", line 70, in run_migrations_online
      context.run_migrations()
    File "&lt;string&gt;", line 7, in run_migrations
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/environment.py", line 688, in run_migrations
      self.get_context().run_migrations(**kw)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/migration.py", line 258, in run_migrations
      change(**kw)
    File "alembic/versions/ec2c2d40eb1_users_change_column_wiki_permission_to_.py", line 27, in upgrade
      existing_server_default=1,
    File "&lt;string&gt;", line 7, in alter_column
    File "&lt;string&gt;", line 1, in &lt;lambda&gt;
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/util.py", line 329, in go
      return fn(*arg, **kw)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/operations.py", line 317, in alter_column
      existing_autoincrement=existing_autoincrement
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/ddl/mysql.py", line 44, in alter_column
      else existing_autoincrement
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/ddl/impl.py", line 76, in _exec
      conn.execute(construct, *multiparams, **params)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 720, in execute
      return meth(self, multiparams, params)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 67, in _execute_on_connection
      return connection._execute_ddl(self, multiparams, params)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 768, in _execute_ddl
      compiled = ddl.compile(dialect=dialect)
    File "&lt;string&gt;", line 1, in &lt;lambda&gt;
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 468, in compile
      return self._compiler(dialect, bind=bind, **kw)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 25, in _compiler
      return dialect.ddl_compiler(dialect, self, **kw)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 197, in __init__
      self.string = self.process(self.statement, **compile_kwargs)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 220, in process
      return obj._compiler_dispatch(self, **kwargs)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/ext/compiler.py", line 410, in &lt;lambda&gt;
      lambda *arg, **kw: existing(*arg, **kw))
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/ext/compiler.py", line 448, in __call__
      return fn(element, compiler, **kw)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/ddl/mysql.py", line 171, in _mysql_change_column
      autoincrement=element.autoincrement
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/ddl/mysql.py", line 190, in _mysql_colspec
      spec += " DEFAULT %s" % _render_value(compiler, server_default)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/ddl/mysql.py", line 179, in _render_value
      return compiler.sql_compiler.process(expr)
    File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 220, in process
      return obj._compiler_dispatch(self, **kwargs)
  AttributeError: 'int' object has no attribute '_compiler_dispatch'
  </code></pre>