Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add house number in models, db_views, alembic #2696

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading