service_man/api/migrations/versions/3ba730985688_initial.py

40 lines
1.0 KiB
Python
Raw Normal View History

2024-03-04 07:12:29 +03:00
"""initial
2024-03-06 03:59:16 +03:00
Revision ID: 3ba730985688
2024-03-04 07:12:29 +03:00
Revises:
2024-03-06 03:59:16 +03:00
Create Date: 2024-03-06 03:10:09.050166
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-06 03:59:16 +03:00
revision: str = "3ba730985688"
2024-03-04 07:12:29 +03:00
down_revision: str | None = None
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",
sa.Column("email", sa.String(), nullable=True),
sa.Column("hashed_password", sa.String(), nullable=True),
sa.Column("is_active", sa.Boolean(), nullable=True),
2024-03-06 03:59:16 +03:00
sa.Column("name", sa.String(), nullable=False),
sa.Column("id", sa.UUID(), nullable=False),
2024-03-04 07:12:29 +03:00
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("email"),
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("users")
# ### end Alembic commands ###