35 lines
1013 B
Python
35 lines
1013 B
Python
"""add_email_field_on_clients_table
|
|
|
|
Revision ID: 6cd898ec9f7c
|
|
Revises: ab6f3a31f3e8
|
|
Create Date: 2025-04-28 15:52:26.406846
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = '6cd898ec9f7c'
|
|
down_revision: Union[str, None] = 'ab6f3a31f3e8'
|
|
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.add_column('clients', sa.Column('email', sa.String(), nullable=False))
|
|
op.create_index(op.f('ix_clients_email'), 'clients', ['email'], unique=True)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(op.f('ix_clients_email'), table_name='clients')
|
|
op.drop_column('clients', 'email')
|
|
# ### end Alembic commands ###
|