|
|
|
|
@ -10,21 +10,41 @@ import sqlalchemy as sa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
|
|
|
revision = '4968a333a100'
|
|
|
|
|
down_revision = 'b76b7f791b3b'
|
|
|
|
|
revision = "4968a333a100"
|
|
|
|
|
down_revision = "b76b7f791b3b"
|
|
|
|
|
branch_labels = None
|
|
|
|
|
depends_on = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade() -> None:
|
|
|
|
|
# ### commands auto generated by Alembic ###
|
|
|
|
|
op.add_column('geodata', sa.Column('depth_min', sa.Float(), sa.Computed("SPLIT_PART(depth,'-',1)", ), nullable=True))
|
|
|
|
|
op.add_column('geodata', sa.Column('depth_max', sa.Float(), sa.Computed("SPLIT_PART(depth,'-',2)", ), nullable=True))
|
|
|
|
|
op.add_column(
|
|
|
|
|
"geodata",
|
|
|
|
|
sa.Column(
|
|
|
|
|
"depth_min",
|
|
|
|
|
sa.Float(),
|
|
|
|
|
sa.Computed(
|
|
|
|
|
"CAST(SPLIT_PART(depth,'-',1) AS DOUBLE PRECISION)",
|
|
|
|
|
),
|
|
|
|
|
nullable=True,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
op.add_column(
|
|
|
|
|
"geodata",
|
|
|
|
|
sa.Column(
|
|
|
|
|
"depth_max",
|
|
|
|
|
sa.Float(),
|
|
|
|
|
sa.Computed(
|
|
|
|
|
"CAST(SPLIT_PART(depth,'-',1) AS DOUBLE PRECISION)",
|
|
|
|
|
),
|
|
|
|
|
nullable=True,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade() -> None:
|
|
|
|
|
# ### commands auto generated by Alembic ###
|
|
|
|
|
op.drop_column('geodata', 'depth_max')
|
|
|
|
|
op.drop_column('geodata', 'depth_min')
|
|
|
|
|
op.drop_column("geodata", "depth_max")
|
|
|
|
|
op.drop_column("geodata", "depth_min")
|
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|