service_man/api/migrations/versions/e98840064cab_first.py

44 lines
1.3 KiB
Python
Raw Normal View History

2024-03-12 01:06:43 +03:00
"""First
2024-03-04 07:12:29 +03:00
2024-03-12 01:06:43 +03:00
Revision ID: e98840064cab
Revises: 629b2e73e311
Create Date: 2024-03-12 01:00:58.640179
2024-03-04 07:12:29 +03:00
"""
2024-03-06 02:28:59 +03:00
from collections.abc import Sequence
2024-03-04 07:12:29 +03:00
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
2024-03-12 01:06:43 +03:00
revision: str = "e98840064cab"
down_revision: str | None = "629b2e73e311"
2024-03-04 07:12:29 +03:00
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"users",
2024-03-12 01:06:43 +03:00
sa.Column("first_name", sa.String(), nullable=False),
sa.Column("mid_name", sa.String(), nullable=False),
sa.Column("last_name", sa.String(), nullable=False),
sa.Column("email", sa.String(), nullable=False),
sa.Column("telegram_id", sa.String(), nullable=False),
sa.Column("hashed_password", sa.String(), nullable=False),
sa.Column("is_active", sa.Boolean(), nullable=False),
2024-03-06 03:59:16 +03:00
sa.Column("id", sa.UUID(), nullable=False),
2024-03-04 07:12:29 +03:00
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("email"),
2024-03-12 01:06:43 +03:00
sa.UniqueConstraint("telegram_id"),
2024-03-04 07:12:29 +03:00
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("users")
# ### end Alembic commands ###