Skip to content

Commit

Permalink
Merge pull request #2670 from data-for-change/add-urban-intersection
Browse files Browse the repository at this point in the history
add urban-intersection to views
  • Loading branch information
atalyaalon committed Jun 16, 2024
2 parents dc7b6c2 + 9575581 commit 410d7fd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
30 changes: 30 additions & 0 deletions alembic/versions/53d0b00fb750_add_non_urban_intersection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""add non_urban_intersection
Revision ID: 53d0b00fb750
Revises: 11ddb0cff075
Create Date: 2024-06-16 15:05:30.522542
"""

# revision identifiers, used by Alembic.
revision = '53d0b00fb750'
down_revision = '11ddb0cff075'
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('urban_intersection', sa.Integer(), nullable=True))
op.add_column('vehicles_markers_hebrew', sa.Column('urban_intersection', sa.Integer(), nullable=True))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('vehicles_markers_hebrew', 'urban_intersection')
op.drop_column('involved_markers_hebrew', 'urban_intersection')
# ### end Alembic commands ###
2 changes: 2 additions & 0 deletions anyway/db_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ def create_involved_hebrew_markers_hebrew_view(self):
AccidentMarkerView.non_urban_intersection,
AccidentMarkerView.non_urban_intersection_hebrew,
AccidentMarkerView.non_urban_intersection_by_junction_number,
AccidentMarkerView.urban_intersection,
AccidentMarkerView.accident_day,
AccidentMarkerView.accident_hour_raw,
AccidentMarkerView.accident_hour_raw_hebrew,
Expand Down Expand Up @@ -838,6 +839,7 @@ def create_vehicles_markers_hebrew_view(self):
AccidentMarkerView.non_urban_intersection,
AccidentMarkerView.non_urban_intersection_hebrew,
AccidentMarkerView.non_urban_intersection_by_junction_number,
AccidentMarkerView.urban_intersection,
AccidentMarkerView.accident_day,
AccidentMarkerView.accident_hour_raw,
AccidentMarkerView.accident_hour_raw_hebrew,
Expand Down
2 changes: 2 additions & 0 deletions anyway/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2505,6 +2505,7 @@ class InvolvedMarkerView(Base):
non_urban_intersection = Column(Integer())
non_urban_intersection_hebrew = Column(Text())
non_urban_intersection_by_junction_number = Column(Text())
urban_intersection = Column(Integer())
accident_day = Column(Integer())
accident_hour_raw = Column(Integer())
accident_hour_raw_hebrew = Column(Text())
Expand Down Expand Up @@ -2701,6 +2702,7 @@ class VehicleMarkerView(Base):
non_urban_intersection = Column(Integer())
non_urban_intersection_hebrew = Column(Text())
non_urban_intersection_by_junction_number = Column(Text())
urban_intersection = Column(Integer())
accident_month = Column(Integer())
accident_day = Column(Integer())
accident_hour_raw = Column(Integer())
Expand Down

0 comments on commit 410d7fd

Please sign in to comment.