alerts: per-support-team webhook + printedparts routing

This commit is contained in:
2026-07-22 13:32:01 -04:00
parent e1c7af049c
commit 73b05e5b1c
9 changed files with 142 additions and 21 deletions

View File

@@ -0,0 +1,41 @@
"""Add supportteams.webhookurl (per-team alert webhook)
A support team can carry a Teams (or other) webhook; alerting plugins route
alerts to a team by selecting it. Nullable. Idempotent guard.
Revision ID: 7d29_supportteam_webhookurl
Revises: 7d28_dashboarddefault_displayrole
Create Date: 2026-07-22
"""
from alembic import op
import sqlalchemy as sa
revision = '7d29_supportteam_webhookurl'
down_revision = '7d28_dashboarddefault_displayrole'
branch_labels = None
depends_on = None
def _has_col(insp):
return any(c['name'] == 'webhookurl'
for c in insp.get_columns('supportteams'))
def upgrade():
bind = op.get_bind()
insp = sa.inspect(bind)
if 'supportteams' not in insp.get_table_names():
return
if not _has_col(insp):
op.add_column('supportteams', sa.Column('webhookurl', sa.Text(), nullable=True))
def downgrade():
bind = op.get_bind()
insp = sa.inspect(bind)
if 'supportteams' not in insp.get_table_names():
return
if _has_col(insp):
op.drop_column('supportteams', 'webhookurl')