Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions alembic/versions/842535e6433f_contact_change.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"""contact change

Revision ID: 842535e6433f
Revises: 8447b9ebaf29
Create Date: 2025-07-23 08:28:14.874799

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "842535e6433f"
down_revision: Union[str, Sequence[str], None] = "8447b9ebaf29"
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.alter_column(
"address", "country", existing_type=sa.VARCHAR(length=100), nullable=False
)
op.alter_column(
"address", "address_type", existing_type=sa.VARCHAR(length=100), nullable=False
)
op.create_foreign_key(None, "address", "lexicon_term", ["country"], ["term"])
op.alter_column(
"email", "email_type", existing_type=sa.VARCHAR(length=100), nullable=False
)
op.alter_column(
"phone", "phone_type", existing_type=sa.VARCHAR(length=100), nullable=False
)
# ### end Alembic commands ###


def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column(
"phone", "phone_type", existing_type=sa.VARCHAR(length=100), nullable=True
)
op.alter_column(
"email", "email_type", existing_type=sa.VARCHAR(length=100), nullable=True
)
op.drop_constraint(None, "address", type_="foreignkey")
op.alter_column(
"address", "address_type", existing_type=sa.VARCHAR(length=100), nullable=True
)
op.alter_column(
"address", "country", existing_type=sa.VARCHAR(length=100), nullable=True
)
# ### end Alembic commands ###
Loading