
- Set up project structure and dependencies - Create database models with SQLAlchemy - Implement API endpoints for CRUD operations - Set up Alembic for database migrations - Add health check endpoint - Configure Ruff for linting - Update documentation in README
35 lines
837 B
Python
35 lines
837 B
Python
"""initial migration
|
|
|
|
Revision ID: 001
|
|
Revises:
|
|
Create Date: 2023-09-26
|
|
|
|
"""
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
from sqlalchemy.sql import func
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "001"
|
|
down_revision = None
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# Create items table
|
|
op.create_table(
|
|
"item",
|
|
sa.Column("id", sa.Integer(), primary_key=True, index=True),
|
|
sa.Column("title", sa.String(100), index=True),
|
|
sa.Column("description", sa.Text(), nullable=True),
|
|
sa.Column("is_active", sa.Boolean(), default=True),
|
|
sa.Column("created_at", sa.DateTime(timezone=True), server_default=func.now()),
|
|
sa.Column("updated_at", sa.DateTime(timezone=True), onupdate=func.now()),
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_table("item")
|