1a195a96bd
- Merge origin/main into branch (resolve conflict in integrations_dashboard.html) - Add defensive JSON parsing with try/except for integration.config - Wrap tester() call in try/except to prevent 500 errors from bad config - Add i18n key integrations.connection_test_failed_fallback in en.json - Reference i18n key in template JS fallback message - Update SECURITY_AUDIT.md: add fix date (2026-03-23), update doc date - Remove accidental revert.sh file - Fix missing MagicMock/patch imports in test file - Add tests for invalid JSON config and tester exception error paths Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/daebb70e-059a-4601-8864-88eef49f99cf
40 lines
1.4 KiB
Python
40 lines
1.4 KiB
Python
"""Add automation_hooks table for Zapier / Make.com webhook subscriptions.
|
|
|
|
Revision ID: 040_add_automation_hooks
|
|
Revises: 039_add_classification_rules
|
|
Create Date: 2026-03-09
|
|
"""
|
|
|
|
from typing import Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision: str = "040_add_automation_hooks"
|
|
down_revision: Union[str, None] = "039_add_classification_rules"
|
|
depends_on: Union[str, None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Create automation_hooks table."""
|
|
op.create_table(
|
|
"automation_hooks",
|
|
sa.Column("id", sa.Integer(), nullable=False),
|
|
sa.Column("target_url", sa.String(), nullable=False),
|
|
sa.Column("secret", sa.String(), nullable=True),
|
|
sa.Column("events", sa.Text(), nullable=False),
|
|
sa.Column("is_active", sa.Boolean(), nullable=False, server_default="1"),
|
|
sa.Column("hook_type", sa.String(50), nullable=False, server_default="generic"),
|
|
sa.Column("description", sa.String(), nullable=True),
|
|
sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.func.now()),
|
|
sa.Column("updated_at", sa.DateTime(timezone=True), server_default=sa.func.now()),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
op.create_index("ix_automation_hooks_id", "automation_hooks", ["id"])
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Drop automation_hooks table."""
|
|
op.drop_index("ix_automation_hooks_id", "automation_hooks")
|
|
op.drop_table("automation_hooks")
|