Made longitude and latitude in vehicle nullable. Fixed postcode being saved in both postcode and city. City is saved in city properly now
This commit is contained in:
@ -0,0 +1,40 @@
|
|||||||
|
"""Made longitude and latitude in vehicle nullable
|
||||||
|
|
||||||
|
Revision ID: 1a457651bb36
|
||||||
|
Revises: 2ea50aba1814
|
||||||
|
Create Date: 2024-10-16 07:33:17.926441
|
||||||
|
|
||||||
|
"""
|
||||||
|
from typing import Sequence, Union
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision: str = '1a457651bb36'
|
||||||
|
down_revision: Union[str, None] = '2ea50aba1814'
|
||||||
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade() -> None:
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.alter_column('vehicles', 'latitude',
|
||||||
|
existing_type=sa.VARCHAR(),
|
||||||
|
nullable=True)
|
||||||
|
op.alter_column('vehicles', 'longitude',
|
||||||
|
existing_type=sa.VARCHAR(),
|
||||||
|
nullable=True)
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade() -> None:
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.alter_column('vehicles', 'longitude',
|
||||||
|
existing_type=sa.VARCHAR(),
|
||||||
|
nullable=False)
|
||||||
|
op.alter_column('vehicles', 'latitude',
|
||||||
|
existing_type=sa.VARCHAR(),
|
||||||
|
nullable=False)
|
||||||
|
# ### end Alembic commands ###
|
||||||
@ -62,8 +62,8 @@ class Vehicle(Base):
|
|||||||
kilometers = Column(Integer, nullable=False)
|
kilometers = Column(Integer, nullable=False)
|
||||||
condition = Column(String, nullable=False)
|
condition = Column(String, nullable=False)
|
||||||
location = Column(String, nullable=False)
|
location = Column(String, nullable=False)
|
||||||
latitude = Column(String, nullable=False)
|
latitude = Column(String, nullable=True)
|
||||||
longitude = Column(String, nullable=False)
|
longitude = Column(String, nullable=True)
|
||||||
gasType = Column(String, nullable=False)
|
gasType = Column(String, nullable=False)
|
||||||
images = Column(Text, nullable=False) # Store image paths or references
|
images = Column(Text, nullable=False) # Store image paths or references
|
||||||
description = Column(String, nullable=False)
|
description = Column(String, nullable=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user