prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Alembic operations fail with multiple head revisions
  ## Description
  
  All Alembic operations fail with Alembic error:
  
      ERROR [alembic.util.messaging] Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '<branchname>@head' to narrow to a specific head, or 'heads' for all heads
  
  Cf. consistent recent failures of CI jobs `app-tests` and `staging-test-with-rebase` since #5974.
  
  ## Steps to Reproduce
  
  `make test` on `develop`; open or push to a PR; etc.
  
  ## Expected Behavior
  
  Alembic operations succeed and Alembic-based tests pass.
  
  ## Actual Behavior
  
  All Alembic operations and tests fail with Alembic error:
  
      ERROR [alembic.util.messaging] Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '<branchname>@head' to narrow to a specific head, or 'heads' for all heads
  
  ## Comments
  
  This is essentially an Alembic-level merge-conflict.  PR forthcoming with the one-line fix.
  
  </issue>
  <code>
  [start of securedrop/alembic/versions/1ddb81fb88c2_unique_index_for_instanceconfig_valid_.py]
  1 """unique_index_for_instanceconfig_valid_until
  2 
  3 Revision ID: 1ddb81fb88c2
  4 Revises: 92fba0be98e9
  5 Create Date: 2021-06-04 17:28:25.725563
  6 
  7 """
  8 from alembic import op
  9 import sqlalchemy as sa
  10 
  11 
  12 # revision identifiers, used by Alembic.
  13 revision = '1ddb81fb88c2'
  14 down_revision = '92fba0be98e9'
  15 branch_labels = None
  16 depends_on = None
  17 
  18 
  19 def upgrade():
  20     # ### commands auto generated by Alembic - please adjust! ###
  21     with op.batch_alter_table('instance_config', schema=None) as batch_op:
  22         batch_op.create_index('ix_one_active_instance_config', [sa.text('valid_until IS NULL')], unique=True, sqlite_where=sa.text('valid_until IS NULL'))
  23 
  24     # ### end Alembic commands ###
  25 
  26 
  27 def downgrade():
  28     # ### commands auto generated by Alembic - please adjust! ###
  29     with op.batch_alter_table('instance_config', schema=None) as batch_op:
  30         batch_op.drop_index('ix_one_active_instance_config')
  31 
  32     # ### end Alembic commands ###
  33
  [end of securedrop/alembic/versions/1ddb81fb88c2_unique_index_for_instanceconfig_valid_.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/securedrop/alembic/versions/1ddb81fb88c2_unique_index_for_instanceconfig_valid_.py b/securedrop/alembic/versions/1ddb81fb88c2_unique_index_for_instanceconfig_valid_.py
  --- a/securedrop/alembic/versions/1ddb81fb88c2_unique_index_for_instanceconfig_valid_.py
  +++ b/securedrop/alembic/versions/1ddb81fb88c2_unique_index_for_instanceconfig_valid_.py
  @@ -11,7 +11,7 @@
   
   # revision identifiers, used by Alembic.
   revision = '1ddb81fb88c2'
  -down_revision = '92fba0be98e9'
  +down_revision = 'b060f38c0c31'
   branch_labels = None
   depends_on = None
  
verification_info: {"golden_diff": "diff --git a/securedrop/alembic/versions/1ddb81fb88c2_unique_index_for_instanceconfig_valid_.py b/securedrop/alembic/versions/1ddb81fb88c2_unique_index_for_instanceconfig_valid_.py\n--- a/securedrop/alembic/versions/1ddb81fb88c2_unique_index_for_instanceconfig_valid_.py\n+++ b/securedrop/alembic/versions/1ddb81fb88c2_unique_index_for_instanceconfig_valid_.py\n@@ -11,7 +11,7 @@\n \n # revision identifiers, used by Alembic.\n revision = '1ddb81fb88c2'\n-down_revision = '92fba0be98e9'\n+down_revision = 'b060f38c0c31'\n branch_labels = None\n depends_on = None\n", "issue": "Alembic operations fail with multiple head revisions\n## Description\r\n\r\nAll Alembic operations fail with Alembic error:\r\n\r\n    ERROR [alembic.util.messaging] Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '<branchname>@head' to narrow to a specific head, or 'heads' for all heads\r\n\r\nCf. consistent recent failures of CI jobs `app-tests` and `staging-test-with-rebase` since #5974.\r\n\r\n## Steps to Reproduce\r\n\r\n`make test` on `develop`; open or push to a PR; etc.\r\n\r\n## Expected Behavior\r\n\r\nAlembic operations succeed and Alembic-based tests pass.\r\n\r\n## Actual Behavior\r\n\r\nAll Alembic operations and tests fail with Alembic error:\r\n\r\n    ERROR [alembic.util.messaging] Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '<branchname>@head' to narrow to a specific head, or 'heads' for all heads\r\n\r\n## Comments\r\n\r\nThis is essentially an Alembic-level merge-conflict.  PR forthcoming with the one-line fix.\n", "before_files": [{"content": "\"\"\"unique_index_for_instanceconfig_valid_until\n\nRevision ID: 1ddb81fb88c2\nRevises: 92fba0be98e9\nCreate Date: 2021-06-04 17:28:25.725563\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as sa\n\n\n# revision identifiers, used by Alembic.\nrevision = '1ddb81fb88c2'\ndown_revision = '92fba0be98e9'\nbranch_labels = None\ndepends_on = None\n\n\ndef upgrade():\n    # ### commands auto generated by Alembic - please adjust! ###\n    with op.batch_alter_table('instance_config', schema=None) as batch_op:\n        batch_op.create_index('ix_one_active_instance_config', [sa.text('valid_until IS NULL')], unique=True, sqlite_where=sa.text('valid_until IS NULL'))\n\n    # ### end Alembic commands ###\n\n\ndef downgrade():\n    # ### commands auto generated by Alembic - please adjust! ###\n    with op.batch_alter_table('instance_config', schema=None) as batch_op:\n        batch_op.drop_index('ix_one_active_instance_config')\n\n    # ### end Alembic commands ###\n", "path": "securedrop/alembic/versions/1ddb81fb88c2_unique_index_for_instanceconfig_valid_.py"}]}