"""Drop the dead ``email_template.welcome`` platform_settings row. Migration 035 seeded ``email_template.welcome`` back when a thin "welcome" email existed. The 2026-06-29 onboarding consolidation merged that into ``hire_day_it_info`` (rich code-generated HTML, PR #1522) and removed the ``welcome`` builtin from ``_DEFAULT_TEMPLATES``. Since then **nothing** sends ``template_key="welcome"`` — the row is unreachable and only served to make the 邮件模板 editor show a phantom "新员工欢迎信" entry that, when edited, changed nothing. Deleting the orphan row is safe: the runtime never reads it, and the editor now drives off the template catalog (which excludes ``welcome`` and surfaces ``hire_day_it_info`` as the real onboarding template). Idempotent: DELETE of a missing key is a no-op. Downgrade is a no-op — re-seeding a dead key would just reintroduce the phantom. Revision ID: 367 Revises: 366 """ from __future__ import annotations import sqlalchemy as sa from alembic import op revision = "367" down_revision = "366" branch_labels = None depends_on = None def upgrade() -> None: bind = op.get_bind() bind.execute( sa.text("DELETE FROM platform_settings WHERE `key` = :k"), {"k": "email_template.welcome"}, ) def downgrade() -> None: # Intentionally a no-op: the ``welcome`` key is dead and re-seeding it # would only resurrect the phantom editor entry. pass