Remove HSTORE tags column from region table
This commit is contained in:
parent
de8d371b65
commit
276a2ddc69
28
api/migrations/versions/5c7755ead95d_remove_region_tags.py
Normal file
28
api/migrations/versions/5c7755ead95d_remove_region_tags.py
Normal 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),
|
||||||
|
)
|
|
@ -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")
|
||||||
|
|
Loading…
Reference in a new issue