- Introduced `pyproject.toml` to centralize backend tool configurations (e.g., Ruff, mypy, coverage, pytest). - Replaced Black, isort, and Flake8 with Ruff for linting, formatting, and import sorting. - Updated `requirements.txt` to include Ruff and remove replaced tools. - Added `Makefile` to streamline development workflows with commands for linting, formatting, type-checking, testing, and cleanup.
47 lines
1.5 KiB
Python
47 lines
1.5 KiB
Python
"""Add all initial models
|
|
|
|
Revision ID: 38bf9e7e74b3
|
|
Revises: 7396957cbe80
|
|
Create Date: 2025-02-28 09:19:33.212278
|
|
|
|
"""
|
|
|
|
from collections.abc import Sequence
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = "38bf9e7e74b3"
|
|
down_revision: str | None = "7396957cbe80"
|
|
branch_labels: str | Sequence[str] | None = None
|
|
depends_on: str | Sequence[str] | None = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
"users",
|
|
sa.Column("email", sa.String(), nullable=False),
|
|
sa.Column("password_hash", sa.String(), nullable=False),
|
|
sa.Column("first_name", sa.String(), nullable=False),
|
|
sa.Column("last_name", sa.String(), nullable=True),
|
|
sa.Column("phone_number", sa.String(), nullable=True),
|
|
sa.Column("is_active", sa.Boolean(), nullable=False),
|
|
sa.Column("is_superuser", sa.Boolean(), nullable=False),
|
|
sa.Column("preferences", sa.JSON(), nullable=True),
|
|
sa.Column("id", sa.UUID(), nullable=False),
|
|
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
|
sa.Column("updated_at", sa.DateTime(timezone=True), nullable=False),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
op.create_index(op.f("ix_users_email"), "users", ["email"], unique=True)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(op.f("ix_users_email"), table_name="users")
|
|
op.drop_table("users")
|
|
# ### end Alembic commands ###
|