Files
eryao/backend/alembic/versions/20260416_0002_drop_duplicate_llm_indexes.py
T
qzl c79c773d67 feat(notification): add target_mode enum constraint and merge register-notifications script
- Add NotificationTargetMode enum (new_users/exist_users/all_users/user_ids)
- Create Alembic migrations: drop duplicate indexes, add target_mode column
- Merge register-notifications.sh into dev-migrate.sh sync-notifications subcommand
- Shorten notification config path: static/notification/notifications -> static/notifications
- Update registration flow to dispatch notifications by target_mode
- Add is_first_registration to RegisterBonusResult for first-time user detection
- Remove dead code: link_published_notifications_to_user
- Update welcome_points.yaml to target new_users only
- Add 44 unit tests + 1 integration test, all passing
2026-04-16 17:50:57 +08:00

26 lines
746 B
Python

"""drop duplicate indexes on llm_factory.name and llms.model_code
Revision ID: 20260416_0002
Revises: 20260416_0001
Create Date: 2026-04-16
"""
from typing import Sequence, Union
from alembic import op
revision: str = "20260416_0002"
down_revision: Union[str, Sequence[str], None] = "20260416_0001"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
op.drop_index("ix_llm_factory_name", table_name="llm_factory")
op.drop_index("ix_llms_model_code", table_name="llms")
def downgrade() -> None:
op.create_index("ix_llm_factory_name", "llm_factory", ["name"], unique=True)
op.create_index("ix_llms_model_code", "llms", ["model_code"], unique=True)