58 lines
1.8 KiB
Python
58 lines
1.8 KiB
Python
"""create members table
|
|||
|
|
|
||
|
|
Revision ID: 0f79356844b5
|
||
|
|
Revises:
|
||
|
|
Create Date: 2025-11-20 11:39:25.900143
|
||
|
|
|
||
|
|
"""
|
||
|
|
|
||
|
|
from typing import Sequence, Union
|
||
|
|
|
||
|
|
import sqlalchemy as sa
|
||
|
|
from alembic import op
|
||
|
|
|
||
|
|
# revision identifiers, used by Alembic.
|
||
|
|
revision: str = "0f79356844b5"
|
||
|
|
down_revision: Union[str, Sequence[str], None] = None
|
||
|
|
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.create_table(
|
||
|
|
"members",
|
||
|
|
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
|
||
|
|
sa.Column("first_name", sa.String(length=100), nullable=False),
|
||
|
|
sa.Column("last_name", sa.String(length=100), nullable=True),
|
||
|
|
sa.Column("street", sa.String(length=200), nullable=True),
|
||
|
|
sa.Column("apartment_number", sa.String(length=20), nullable=True),
|
||
|
|
sa.Column("zip", sa.String(length=20), nullable=True),
|
||
|
|
sa.Column("city", sa.String(length=100), nullable=True),
|
||
|
|
sa.Column("country", sa.String(length=100), nullable=True),
|
||
|
|
sa.Column("email", sa.String(length=255), nullable=True),
|
||
|
|
sa.Column("phone", sa.String(length=50), nullable=True),
|
||
|
|
sa.Column(
|
||
|
|
"created_at",
|
||
|
|
sa.DateTime(),
|
||
|
|
server_default=sa.text("(CURRENT_TIMESTAMP)"),
|
||
|
|
nullable=False,
|
||
|
|
),
|
||
|
|
sa.Column(
|
||
|
|
"updated_at",
|
||
|
|
sa.DateTime(),
|
||
|
|
server_default=sa.text("(CURRENT_TIMESTAMP)"),
|
||
|
|
nullable=False,
|
||
|
|
),
|
||
|
|
sa.PrimaryKeyConstraint("id"),
|
||
|
|
)
|
||
|
|
# ### end Alembic commands ###
|
||
|
|
|
||
|
|
|
||
|
|
def downgrade() -> None:
|
||
|
|
"""Downgrade schema."""
|
||
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
|
op.drop_table("members")
|
||
|
|
# ### end Alembic commands ###
|