chore(home): mirror from kalinamall (9883e6a) with papatramp URLs
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
"""notification_policy singleton (global severity rule)
|
||||
|
||||
Revision ID: 007
|
||||
Revises: 006
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision: str = "007"
|
||||
down_revision: Union[str, None] = "006"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.create_table(
|
||||
"notification_policy",
|
||||
sa.Column("id", sa.Integer(), nullable=False),
|
||||
sa.Column("min_severity", sa.String(length=16), nullable=False, server_default="warning"),
|
||||
sa.Column("use_telegram", sa.Boolean(), nullable=False, server_default=sa.text("true")),
|
||||
sa.Column("use_webhook", sa.Boolean(), nullable=False, server_default=sa.text("false")),
|
||||
sa.Column("use_email", sa.Boolean(), nullable=False, server_default=sa.text("false")),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
op.execute(
|
||||
sa.text(
|
||||
"INSERT INTO notification_policy (id, min_severity, use_telegram, use_webhook, use_email) "
|
||||
"VALUES (1, 'warning', true, false, false)"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_table("notification_policy")
|
||||
Reference in New Issue
Block a user