Skip to content

Commit

Permalink
add house number in models, db_views, alembic (#2696)
Browse files Browse the repository at this point in the history
* add house number in models, db_views, alembic
  • Loading branch information
atalyaalon authored Sep 4, 2024
1 parent f7ef58d commit 2e57cba
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
31 changes: 31 additions & 0 deletions alembic/versions/mn9px8cacn24_add_house_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""add house number
Revision ID: mn9px8cacn24
Revises: 97740b33407d
Create Date: 2024-06-16 15:05:30.522542
"""

# revision identifiers, used by Alembic.
revision = 'mn9px8cacn24'
down_revision = '97740b33407d'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('involved_markers_hebrew', sa.Column('house_number', sa.Integer(), nullable=True))
op.add_column('vehicles_markers_hebrew', sa.Column('house_number', sa.Integer(), nullable=True))

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('vehicles_markers_hebrew', 'house_number')
op.drop_column('involved_markers_hebrew', 'house_number')
# ### end Alembic commands ###
1 change: 1 addition & 0 deletions anyway/db_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ def create_vehicles_markers_hebrew_view(self):
AccidentMarkerView.street1_hebrew,
AccidentMarkerView.street2,
AccidentMarkerView.street2_hebrew,
AccidentMarkerView.house_number,
AccidentMarkerView.non_urban_intersection,
AccidentMarkerView.non_urban_intersection_hebrew,
AccidentMarkerView.non_urban_intersection_by_junction_number,
Expand Down
2 changes: 2 additions & 0 deletions anyway/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2532,6 +2532,7 @@ class InvolvedMarkerView(Base):
street1_hebrew = Column(Text(), index=True)
street2 = Column(Integer())
street2_hebrew = Column(Text(), index=True)
house_number = Column(Integer())
non_urban_intersection = Column(Integer())
non_urban_intersection_hebrew = Column(Text())
non_urban_intersection_by_junction_number = Column(Text())
Expand Down Expand Up @@ -2729,6 +2730,7 @@ class VehicleMarkerView(Base):
street1_hebrew = Column(Text(), index=True)
street2 = Column(Integer())
street2_hebrew = Column(Text(), index=True)
house_number = Column(Integer())
non_urban_intersection = Column(Integer())
non_urban_intersection_hebrew = Column(Text())
non_urban_intersection_by_junction_number = Column(Text())
Expand Down

0 comments on commit 2e57cba

Please sign in to comment.