remove contact table

This commit is contained in:
2025-10-01 22:36:32 +03:00
parent 58185a11a9
commit 2c7522018f
2 changed files with 43 additions and 13 deletions

View File

@@ -0,0 +1,41 @@
"""remove contact table
Revision ID: 603af861b193
Revises: c151f5abb66d
Create Date: 2025-10-01 22:35:33.898996
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '603af861b193'
down_revision: Union[str, Sequence[str], None] = 'c151f5abb66d'
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.drop_table('contact')
op.add_column('user', sa.Column('email', sa.String(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user', 'email')
op.create_table('contact',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column('type', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('value', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], name=op.f('contact_user_id_fkey')),
sa.PrimaryKeyConstraint('id', name=op.f('contact_pkey'))
)
# ### end Alembic commands ###