title: Alembic autogenerate empty migration file
body: <p>I'm trying to connect the <code>alembic</code> library to the <a href="https://www.encode.io/databases/" rel="nofollow noreferrer">databases</a> and <code>sqlalchemy</code> libraries. As a guide, I use this example  <a href="https://www.starlette.io/database/" rel="nofollow noreferrer">link</a></p>
  <p>My projects file:</p>
  <p><strong>db.py</strong></p>
  <pre><code>from databases import Database
  from sqlalchemy import MetaData, create_engine
  
  DATABASE_URL = &quot;postgresql://....@localhost:5432/db&quot;
  
  engine = create_engine(DATABASE_URL)
  metadata = MetaData()
  
  database = Database(DATABASE_URL)
  </code></pre>
  <p><strong>models.py</strong></p>
  <pre><code>from sqlalchemy import Table, Column, Integer, String, DateTime
  from sqlalchemy.sql import func
  
  from db import metadata
  
  notes = Table(
      &quot;notes&quot;,
      metadata,
      Column(&quot;id&quot;, Integer, primary_key=True),
      Column(&quot;title&quot;, String(50)),
      Column(&quot;description&quot;, String(50)),
      Column(&quot;created_date&quot;, DateTime, default=func.now(), nullable=False),
  )
  </code></pre>
  <p><strong>env.py</strong> (alembic settings)</p>
  <pre><code>from db import DATABASE_URL, metadata
  
  ....
  #add new
  target_metadata = metadata
  ...
  #change
  def run_migrations_online():
  
      config.set_main_option('sqlalchemy.url', str(DATABASE_URL))
      connectable = engine_from_config(
          config.get_section(config.config_ini_section),
          prefix=&quot;sqlalchemy.&quot;,
          poolclass=pool.NullPool,
      )
  </code></pre>
  <p>When I run</p>
  <pre><code>alembic revision --autogenerate -m 'Add notest table'
  </code></pre>
  <p>the new file at migrations/versions this context is created</p>
  <pre><code>def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      pass
      # ### end Alembic commands ###
  
  
  def downgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      pass
      # ### end Alembic commands ###
  </code></pre>
  <p>I suppose it may be related to the use of the target_metadata = metadata variable. It seems to be all according to instructions, but the migrations do not work as expected.</p>