remove contact table
This commit is contained in:
41
alembic/versions/603af861b193_remove_contact_table.py
Normal file
41
alembic/versions/603af861b193_remove_contact_table.py
Normal 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 ###
|
||||
Reference in New Issue
Block a user