Remove HSTORE tags column from region table

This commit is contained in:
Paul Bienkowski 2023-03-26 13:00:53 +02:00
parent de8d371b65
commit 276a2ddc69
2 changed files with 29 additions and 2 deletions

View file

@ -0,0 +1,28 @@
"""remove region tags
Revision ID: 5c7755ead95d
Revises: f7b21148126a
Create Date: 2023-03-26 09:36:46.808239
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import HSTORE
# revision identifiers, used by Alembic.
revision = "5c7755ead95d"
down_revision = "f7b21148126a"
branch_labels = None
depends_on = None
def upgrade():
op.drop_column("region", "tags")
def downgrade():
op.add_column(
"region",
sa.Column("tags", HSTORE, nullable=True),
)

View file

@ -35,7 +35,7 @@ from sqlalchemy import (
text, text,
literal, literal,
) )
from sqlalchemy.dialects.postgresql import HSTORE, UUID from sqlalchemy.dialects.postgresql import UUID
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -475,7 +475,6 @@ class Region(Base):
name = Column(String) name = Column(String)
geometry = Column(Geometry) geometry = Column(Geometry)
admin_level = Column(Integer) admin_level = Column(Integer)
tags = Column(HSTORE)
Comment.author = relationship("User", back_populates="authored_comments") Comment.author = relationship("User", back_populates="authored_comments")