fix region DB schema
This commit is contained in:
parent
19a8112905
commit
68c37be383
|
@ -22,13 +22,12 @@ def upgrade():
|
||||||
op.create_table(
|
op.create_table(
|
||||||
"region",
|
"region",
|
||||||
sa.Column(
|
sa.Column(
|
||||||
"way_id", sa.BIGINT, autoincrement=True, primary_key=True, index=True
|
"relation_id", sa.BIGINT, autoincrement=True, primary_key=True, index=True
|
||||||
),
|
),
|
||||||
sa.Column("zone", dbtype("zone_type")),
|
|
||||||
sa.Column("name", sa.String),
|
sa.Column("name", sa.String),
|
||||||
sa.Column("geometry", dbtype("GEOMETRY"), index=True),
|
sa.Column("geometry", dbtype("GEOMETRY"), index=True),
|
||||||
sa.Column("directionality", sa.Integer),
|
sa.Column("admin_level", sa.Integer, index=True),
|
||||||
sa.Column("oenway", sa.Boolean),
|
sa.Column("tags", dbtype("HSTORE")),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -432,6 +432,16 @@ class Comment(Base):
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Region(Base):
|
||||||
|
__tablename__ = "region"
|
||||||
|
|
||||||
|
relation_id = Column(BIGINT, primary_key=True, index=True)
|
||||||
|
name = Column(String)
|
||||||
|
geometry = Column(Geometry)
|
||||||
|
admin_level = Column(Integer)
|
||||||
|
tags = Column(HSTORE)
|
||||||
|
|
||||||
|
|
||||||
Comment.author = relationship("User", back_populates="authored_comments")
|
Comment.author = relationship("User", back_populates="authored_comments")
|
||||||
User.authored_comments = relationship(
|
User.authored_comments = relationship(
|
||||||
"Comment",
|
"Comment",
|
||||||
|
|
Loading…
Reference in a new issue