FastAPI + SQLAlchemy/Alembic + MariaDB backend with Jinja2/htmx/Alpine server-rendered frontend. Multi-user via Google OAuth, daily habit tracking, monthly/weekly history views, Web Push reminders via APScheduler, and PWA support (manifest, service worker, offline caching). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
"""add summary_notification_log table
|
|
|
|
Revision ID: 0005_add_summary_notification_log
|
|
Revises: 0004_add_user_id_columns
|
|
Create Date: 2026-07-16
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision: str = "0005_add_summary_notif_log"
|
|
down_revision: Union[str, None] = "0004_add_user_id_columns"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
"summary_notification_log",
|
|
sa.Column("id", sa.Integer(), primary_key=True, autoincrement=True),
|
|
sa.Column("user_id", sa.Integer(), sa.ForeignKey("user.id", ondelete="CASCADE"), nullable=False),
|
|
sa.Column("period_type", sa.String(length=20), nullable=False),
|
|
sa.Column("period_start", sa.Date(), nullable=False),
|
|
sa.Column("sent_at", sa.DateTime(), nullable=False, server_default=sa.func.now()),
|
|
sa.UniqueConstraint("user_id", "period_type", "period_start", name="uq_summary_user_period"),
|
|
mysql_engine="InnoDB",
|
|
mysql_charset="utf8mb4",
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_table("summary_notification_log")
|