chore(home): mirror from kalinamall (9883e6a) with papatramp URLs

This commit is contained in:
2026-07-14 20:43:52 +10:00
commit ed4e78f6c3
312 changed files with 42790 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
"""problems table
Revision ID: 002
Revises: 001
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
revision: str = "002"
down_revision: Union[str, None] = "001"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
op.create_table(
"problems",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("host_id", sa.Integer(), nullable=True),
sa.Column("title", sa.String(length=256), nullable=False),
sa.Column("summary", sa.Text(), nullable=False),
sa.Column("severity", sa.String(length=16), nullable=False),
sa.Column("status", sa.String(length=32), nullable=False, server_default="open"),
sa.Column("rule_id", sa.String(length=64), nullable=True),
sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=False),
sa.Column("updated_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=False),
sa.ForeignKeyConstraint(["host_id"], ["hosts.id"]),
sa.PrimaryKeyConstraint("id"),
)
op.create_index("ix_problems_status", "problems", ["status"])
op.create_index("ix_problems_severity", "problems", ["severity"])
op.create_table(
"problem_events",
sa.Column("problem_id", sa.Integer(), nullable=False),
sa.Column("event_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(["event_id"], ["events.id"], ondelete="CASCADE"),
sa.ForeignKeyConstraint(["problem_id"], ["problems.id"], ondelete="CASCADE"),
sa.PrimaryKeyConstraint("problem_id", "event_id"),
)
def downgrade() -> None:
op.drop_table("problem_events")
op.drop_table("problems")