diff --git a/api/migrations/versions/5c7755ead95d_remove_region_tags.py b/api/migrations/versions/5c7755ead95d_remove_region_tags.py new file mode 100644 index 0000000..08fe361 --- /dev/null +++ b/api/migrations/versions/5c7755ead95d_remove_region_tags.py @@ -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), + ) diff --git a/api/obs/api/db.py b/api/obs/api/db.py index 5793558..6025300 100644 --- a/api/obs/api/db.py +++ b/api/obs/api/db.py @@ -35,7 +35,7 @@ from sqlalchemy import ( text, literal, ) -from sqlalchemy.dialects.postgresql import HSTORE, UUID +from sqlalchemy.dialects.postgresql import UUID log = logging.getLogger(__name__) @@ -475,7 +475,6 @@ class Region(Base): name = Column(String) geometry = Column(Geometry) admin_level = Column(Integer) - tags = Column(HSTORE) Comment.author = relationship("User", back_populates="authored_comments")