title: Flask-migrate and changing column type
body: <p>I am trying to learn some Flask and I am using Flask-Migrate 1.6.0</p>
  
  <p>So I made a model which looks like this</p>
  
  <pre class="lang-py prettyprint-override"><code>class Download(db.Model):
  
      __tablename__ = "downloads"
  
      id = db.Column(db.Integer, autoincrement=True, primary_key=True)
      filename = db.Column(db.String, nullable=False)
      size = db.Column(db.Integer, nullable=False)
      location = db.Column(db.String, nullable=False)
      season = db.Column(db.Integer, nullable=False)
      download_timestamp = db.Column(db.DateTime, nullable=False)
  
      show_id = db.Column(db.Integer, ForeignKey("shows.id"))
  
      def __init__(self,filename,size,location,timestamp,season):
          self.filename = filename
          self.size = size
          self.location = location
          self.download_timestamp = timestamp
          self.season = season
  
      def __repr__(self):
          return '&lt;File {}'.format(self.filename)
  </code></pre>
  
  <p>I have then changed it to the exact same thing except for this line :</p>
  
  <pre class="lang-py prettyprint-override"><code>size = db.Column(db.BigInteger, nullable=False)
  </code></pre>
  
  <p>When I run my </p>
  
  <pre class="lang-sh prettyprint-override"><code>manager.py db migrate
  </code></pre>
  
  <p>command it doesn't detect the change in the column type. And I have read up on it and I know it should pick it up when I change my env.py and add the compare_type=True variable. But I did this to no avail, the method looks like this right now</p>
  
  <pre class="lang-py prettyprint-override"><code>def run_migrations_online():
      """Run migrations in 'online' mode.
  
      In this scenario we need to create an Engine
      and associate a connection with the context.
  
      """
  
      # this callback is used to prevent an auto-migration from being generated
      # when there are no changes to the schema
      # reference: http://alembic.readthedocs.org/en/latest/cookbook.html
      def process_revision_directives(context, revision, directives):
          if getattr(config.cmd_opts, 'autogenerate', False):
              script = directives[0]
              if script.upgrade_ops.is_empty():
                  directives[:] = []
                  logger.info('No changes in schema detected.')
  
      engine = engine_from_config(config.get_section(config.config_ini_section),
                                  prefix='sqlalchemy.',
                                  poolclass=pool.NullPool)
  
      connection = engine.connect()
      context.configure(connection=connection,
                        target_metadata=target_metadata,
                        compare_type=True,
                        process_revision_directives=process_revision_directives,
                        **current_app.extensions['migrate'].configure_args)
  
      try:
          with context.begin_transaction():
              context.run_migrations()
      finally:
          connection.close()
  </code></pre>
  
  <p>Ok so my questions are:</p>
  
  <p>Did I do something wrong in changing the env.py file?</p>
  
  <p>If I didn't and it still doesn't pick up on it how do I exactly manually make the next migration revision? Because the revisions in my migrate folder have names like below and stuff in it like this </p>
  
  <pre class="lang-py prettyprint-override"><code># revision identifiers, used by Alembic.
  revision = '7e9f264b0f'
  down_revision = '2e59d536f50'
  </code></pre>
  
  <p>I guess I could just copy one, make up a name .. but would the next one that is picked up by flask migrate recognize it? So yeah.. what is the correct way of handling it without too much iffy hacking?</p>