title: Alembic SQLite ALTER TABLE with self-referencing foreign key
body: <p>The Alembic migration for a SQLite database:</p>
  
  <pre><code>def upgrade():
      with op.batch_alter_table('my_table') as batch_op:
          batch_op.add_column(sa.Column('parent_id', sa.String(24)))
          batch_op.create_foreign_key('parent_constraint', 'my_table', ['parent_id'], ['id'])
  </code></pre>
  
  <p>which is supposed to create a foreign key <code>parent_id</code> referencing <code>id</code> of the same table <code>my_table</code>, creates a reference to a table called <code>_alembic_batch_temp</code>:</p>
  
  <pre><code>CREATE TABLE "my_table" (
      id VARCHAR(24) NOT NULL, 
      parent_id VARCHAR(24), 
      PRIMARY KEY (id), 
      CONSTRAINT parent_constraint FOREIGN KEY(parent_id) REFERENCES _alembic_batch_temp (id)
  )
  </code></pre>
  
  <p>How to create self-referencing constraints when altering a table?</p>