2025-02-19 15:55:16 +01:00

50 lines
1.8 KiB
Python

"""
Revision ID: bbee168ba406
Revises:
Create Date: 2025-02-19 15:48:47.075283
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision: str = 'bbee168ba406'
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:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('house')
op.drop_table('owner')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('owner',
sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
sa.Column('user_id', sa.UUID(), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], name='owner_user_id_fkey'),
sa.PrimaryKeyConstraint('id', name='owner_pkey'),
postgresql_ignore_search_path=False
)
op.create_table('house',
sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
sa.Column('address', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('city', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('country', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('price', sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False),
sa.Column('description', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('owner_id', sa.UUID(), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(['owner_id'], ['owner.id'], name='house_owner_id_fkey'),
sa.PrimaryKeyConstraint('id', name='house_pkey')
)
# ### end Alembic commands ###