* adding ruff auto check for pull requests as well as fixing all ruff errors * More ruff fixes: forgot half of the ruff checks Forgot to do a git add all :D --------- Co-authored-by: Kadir <git@k8n.dev>
82 lines
3.6 KiB
Python
82 lines
3.6 KiB
Python
"""initial
|
|
|
|
Revision ID: 6363b18a22ca
|
|
Revises:
|
|
Create Date: 2025-06-22 15:27:23.187594
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
import sqlmodel
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = '6363b18a22ca'
|
|
down_revision: Union[str, None] = None
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Upgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('buylisting',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('price', sa.Float(), nullable=False),
|
|
sa.Column('number_of_bedrooms', sa.Integer(), nullable=False),
|
|
sa.Column('square_meters', sa.Float(), nullable=True),
|
|
sa.Column('agency', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
sa.Column('council_tax_band', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
sa.Column('longitude', sa.Float(), nullable=False),
|
|
sa.Column('latitude', sa.Float(), nullable=False),
|
|
sa.Column('price_history_json', sa.TEXT(), nullable=False),
|
|
sa.Column('listing_site', sa.Enum('RIGHTMOVE', name='listingsite'), nullable=False),
|
|
sa.Column('last_seen', sa.DateTime(), nullable=False),
|
|
sa.Column('photo_thumbnail', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
sa.Column('floorplan_image_paths', sa.JSON(), nullable=False),
|
|
sa.Column('additional_info', sa.JSON(), nullable=False),
|
|
sa.Column('routing_info_json', sa.TEXT(), nullable=True),
|
|
sa.Column('service_charge', sa.Float(), nullable=True),
|
|
sa.Column('lease_left', sa.Integer(), nullable=True),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_table('rentlisting',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('price', sa.Float(), nullable=False),
|
|
sa.Column('number_of_bedrooms', sa.Integer(), nullable=False),
|
|
sa.Column('square_meters', sa.Float(), nullable=True),
|
|
sa.Column('agency', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
sa.Column('council_tax_band', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
sa.Column('longitude', sa.Float(), nullable=False),
|
|
sa.Column('latitude', sa.Float(), nullable=False),
|
|
sa.Column('price_history_json', sa.TEXT(), nullable=False),
|
|
sa.Column('listing_site', sa.Enum('RIGHTMOVE', name='listingsite'), nullable=False),
|
|
sa.Column('last_seen', sa.DateTime(), nullable=False),
|
|
sa.Column('photo_thumbnail', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
|
|
sa.Column('floorplan_image_paths', sa.JSON(), nullable=False),
|
|
sa.Column('additional_info', sa.JSON(), nullable=False),
|
|
sa.Column('routing_info_json', sa.TEXT(), nullable=True),
|
|
sa.Column('available_from', sa.DateTime(), nullable=True),
|
|
sa.Column('furnish_type', sa.Enum('FURNISHED', 'UNFURNISHED', 'PART_FURNISHED', 'ASK_LANDLORD', 'UNKNOWN', name='furnishtype'), nullable=False),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_table('user',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('email', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
sa.Column('password', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(op.f('ix_user_email'), table_name='user')
|
|
op.drop_table('user')
|
|
op.drop_table('rentlisting')
|
|
op.drop_table('buylisting')
|
|
# ### end Alembic commands ###
|