Skip to content

Commit

Permalink
Fix migration
Browse files Browse the repository at this point in the history
  • Loading branch information
margrietpalm committed Jan 23, 2024
1 parent f8005fe commit f90ee1b
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""rename vegetation columns
Revision ID: 0218
Revises: 0217
Create Date: 2023-12-22 08:33
Revision ID: 0219
Revises: 0218
Create Date: 2024-01-22 15:00
"""

Expand All @@ -15,7 +15,18 @@
branch_labels = None
depends_on = None

MIGRATION_QUERIES = """
SELECT RecoverGeometryColumn('v2_cross_section_location', 'the_geom', 4326, 'POINT', 'XY')
"""


def upgrade():
with op.batch_alter_table("v2_cross_section_location") as batch_op:
batch_op.alter_column("friction_value", nullable=True, type_=sa.TEXT)
batch_op.alter_column("friction_value", nullable=True, type_=sa.Float)
for q in MIGRATION_QUERIES.split(";"):
op.execute(sa.text(q))


def downgrade():
with op.batch_alter_table("v2_cross_section_location") as batch_op:
batch_op.alter_column("friction_value", nullable=False, type_=sa.Float)

0 comments on commit f90ee1b

Please sign in to comment.