Skip to content

Commit

Permalink
Merge pull request #189 from sanger/dpl146_increase_baracoda_current_…
Browse files Browse the repository at this point in the history
…value

Dpl146 increase baracoda current value
  • Loading branch information
emrojo authored Oct 13, 2021
2 parents c9db592 + 3956aa1 commit 27fbba6
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.0
2.7.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""Move forward current value for heron
Revision ID: bc442d63d7d3
Revises: a32c725ae353
Create Date: 2021-10-13 14:07:48.425000
"""
from alembic import op
import os

# revision identifiers, used by Alembic.
revision = "bc442d63d7d3"
down_revision = "a32c725ae353"
branch_labels = None
depends_on = None


def __DANGER_restart_sequence_with(value):
if os.environ.get("CONFIRM_HERON_SEQUENCE_RESTART") is None:
description = (
"'This migration is potentially destructive. Update the value for RESTART WITH"
"to a known unused value and set the environment variable "
"CONFIRM_HERON_SEQUENCE_RESTART to confirm you want to apply this migration.'"
)
raise ValueError(description)
# Last value in database is 2564197, we want to move forward past this value
op.execute(f"ALTER SEQUENCE heron RESTART WITH { value };")


def upgrade():
# Last value in database is 2564197, we want to move forward past this value
__DANGER_restart_sequence_with(2564300)


def downgrade():
# Actual value in Baracoda is 2156143, but if we rollback we can leave a bit of space
# Please retrieve a sensible value and edit if you plan to downgrade
description = (
"\nPlease substitute this exception with a line in python like: \n"
"__DANGER_restart_sequence_with(<newvalue>)\n"
"where <newvalue> is a SAFE value you estimate.\n"
)
raise Exception(description)

0 comments on commit 27fbba6

Please sign in to comment.