
# revision identifiers, used by Alembic.
revision = '1815829d365'
down_revision = '3fcddd64a72'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    # create new unique index to include geo app ref
    op.execute("DROP INDEX title_abr_idx")
    op.execute("CREATE UNIQUE INDEX title_abr_geo_idx ON records((record->'data'->>'title_number'),(record->'data'->>'application_reference'), (record->'data'->>'geometry_application_reference'))")
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.execute("DROP INDEX title_abr_geo_idx")
    op.execute("CREATE UNIQUE INDEX title_abr_idx ON records((record->'data'->>'title_number'),(record->'data'->>'application_reference'))")
    ### end Alembic commands ###


# revision identifiers, used by Alembic.
revision = '1815829d365'
down_revision = '3fcddd64a72'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    # create new unique index to include geometry_application_ref
    op.execute("DROP INDEX title_abr_idx")
    op.execute("CREATE UNIQUE INDEX title_abr_geo_idx ON records((record->'data'->>'title_number'),(record->'data'->>'application_reference'), (record->'data'->>'geometry_application_reference'))")
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.execute("DROP INDEX title_abr_geo_idx")
    op.execute("CREATE UNIQUE INDEX title_abr_idx ON records((record->'data'->>'title_number'),(record->'data'->>'application_reference'))")
    ### end Alembic commands ###

Add geometry_application_reference to new unique index.
Add geometry_application_reference to new unique index.

  
  # revision identifiers, used by Alembic.
  revision = '1815829d365'
  down_revision = '3fcddd64a72'
  
  from alembic import op
  import sqlalchemy as sa
  
  
  def upgrade():
      ### commands auto generated by Alembic - please adjust! ###
-     # create new unique index to include geo app ref
+     # create new unique index to include geometry_application_ref
      op.execute("DROP INDEX title_abr_idx")
      op.execute("CREATE UNIQUE INDEX title_abr_geo_idx ON records((record->'data'->>'title_number'),(record->'data'->>'application_reference'), (record->'data'->>'geometry_application_reference'))")
      ### end Alembic commands ###
  
  
  def downgrade():
      ### commands auto generated by Alembic - please adjust! ###
      op.execute("DROP INDEX title_abr_geo_idx")
      op.execute("CREATE UNIQUE INDEX title_abr_idx ON records((record->'data'->>'title_number'),(record->'data'->>'application_reference'))")
      ### end Alembic commands ###
  
Add geometry_application_reference to new unique index.
## Code Before:

# revision identifiers, used by Alembic.
revision = '1815829d365'
down_revision = '3fcddd64a72'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    # create new unique index to include geo app ref
    op.execute("DROP INDEX title_abr_idx")
    op.execute("CREATE UNIQUE INDEX title_abr_geo_idx ON records((record->'data'->>'title_number'),(record->'data'->>'application_reference'), (record->'data'->>'geometry_application_reference'))")
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.execute("DROP INDEX title_abr_geo_idx")
    op.execute("CREATE UNIQUE INDEX title_abr_idx ON records((record->'data'->>'title_number'),(record->'data'->>'application_reference'))")
    ### end Alembic commands ###

## Instruction:
Add geometry_application_reference to new unique index.
## Code After:

# revision identifiers, used by Alembic.
revision = '1815829d365'
down_revision = '3fcddd64a72'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    # create new unique index to include geometry_application_ref
    op.execute("DROP INDEX title_abr_idx")
    op.execute("CREATE UNIQUE INDEX title_abr_geo_idx ON records((record->'data'->>'title_number'),(record->'data'->>'application_reference'), (record->'data'->>'geometry_application_reference'))")
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.execute("DROP INDEX title_abr_geo_idx")
    op.execute("CREATE UNIQUE INDEX title_abr_idx ON records((record->'data'->>'title_number'),(record->'data'->>'application_reference'))")
    ### end Alembic commands ###
