- Backend: FastAPI + SQLAlchemy + Celery (Python 3.11+) - Frontend: Vue 3 + TypeScript + Pinia + Tailwind - Admin Frontend: separate Vue 3 app for management - Docker Compose: 9 services orchestration - Specs: design prototypes, memory system PRD, product roadmap Cleanup performed: - Removed temporary debug scripts from backend root - Removed deprecated admin_app.py (embedded UI) - Removed duplicate docs from admin-frontend - Updated .gitignore for Vite cache and egg-info
43 lines
1.6 KiB
Python
43 lines
1.6 KiB
Python
"""add child profiles
|
|
|
|
Revision ID: 0004_add_child_profiles
|
|
Revises: 0003_add_monitoring
|
|
Create Date: 2025-12-22
|
|
"""
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "0004_add_child_profiles"
|
|
down_revision = "0003_add_monitoring"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
op.create_table(
|
|
"child_profiles",
|
|
sa.Column("id", sa.String(36), primary_key=True),
|
|
sa.Column("user_id", sa.String(255), sa.ForeignKey("users.id", ondelete="CASCADE"), nullable=False),
|
|
sa.Column("name", sa.String(50), nullable=False),
|
|
sa.Column("avatar_url", sa.String(500)),
|
|
sa.Column("birth_date", sa.Date()),
|
|
sa.Column("gender", sa.String(10)),
|
|
sa.Column("interests", sa.JSON(), server_default="[]", nullable=False),
|
|
sa.Column("growth_themes", sa.JSON(), server_default="[]", nullable=False),
|
|
sa.Column("reading_preferences", sa.JSON(), server_default="{}", nullable=False),
|
|
sa.Column("stories_count", sa.Integer(), server_default="0", nullable=False),
|
|
sa.Column("total_reading_time", sa.Integer(), server_default="0", nullable=False),
|
|
sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.func.now()),
|
|
sa.Column("updated_at", sa.DateTime(timezone=True), server_default=sa.func.now()),
|
|
sa.UniqueConstraint("user_id", "name", name="uq_child_profile_user_name"),
|
|
)
|
|
op.create_index("idx_child_profiles_user_id", "child_profiles", ["user_id"])
|
|
|
|
|
|
def downgrade():
|
|
op.drop_index("idx_child_profiles_user_id", table_name="child_profiles")
|
|
op.drop_table("child_profiles")
|