41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
"""Add contact fields to User model
|
|
|
|
Revision ID: 43dfd2543fad
|
|
Revises: dbcb5d2d3ed0
|
|
Create Date: 2025-05-23 09:24:23.926302
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '43dfd2543fad'
|
|
down_revision = 'dbcb5d2d3ed0'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('user', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('phone', sa.String(length=20), nullable=True))
|
|
batch_op.add_column(sa.Column('company', sa.String(length=100), nullable=True))
|
|
batch_op.add_column(sa.Column('position', sa.String(length=100), nullable=True))
|
|
batch_op.add_column(sa.Column('notes', sa.Text(), nullable=True))
|
|
batch_op.add_column(sa.Column('is_active', sa.Boolean(), nullable=True))
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('user', schema=None) as batch_op:
|
|
batch_op.drop_column('is_active')
|
|
batch_op.drop_column('notes')
|
|
batch_op.drop_column('position')
|
|
batch_op.drop_column('company')
|
|
batch_op.drop_column('phone')
|
|
|
|
# ### end Alembic commands ###
|