e518bce922
Resolve all merge conflicts between our automation feature branch and current main (v0.163.0, 920 commits ahead). Conflicts resolved: - app/api/__init__.py: add automation_router alongside main's new routers (classification_rules, qr_auth, sessions, system_reset) - app/config.py: add main's new settings (dropbox_use_global_credentials, factory_reset_on_startup, enable_factory_reset) - app/models.py: add main's new models (ClassificationRuleModel, UserSession, QRLoginChallenge, SharePoint integration type) - app/utils/settings_service.py: merge automation_hooks_enabled with main's new metadata entries - docs/API.md: merge automation API docs with main's classification rules docs - docs/ConfigurationGuide.md: add factory reset settings - tests/conftest.py: import both AutomationHook and new main models Migration renumbered: - 037_add_automation_hooks → 040_add_automation_hooks - down_revision: 039_add_classification_rules (was 036_add_document_translation_fields) - Chain: 036 → 037 → 038 → 039 → 040 (automation hooks) For all non-automation files with conflicts, main's version was taken since our branch did not modify those files (conflicts were from a stale prior merge). Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/cb62f012-3b69-4415-835e-3857ce3e9f45
41 lines
1.2 KiB
Mako
41 lines
1.2 KiB
Mako
"""${message}
|
||
|
||
Revision ID: ${up_revision}
|
||
Revises: ${down_revision | comma,n}
|
||
Create Date: ${create_date}
|
||
|
||
"""
|
||
|
||
from typing import Union
|
||
|
||
import sqlalchemy as sa
|
||
from alembic import op
|
||
|
||
# revision identifiers, used by Alembic.
|
||
revision: str = ${repr(up_revision)}
|
||
down_revision: Union[str, None] = ${repr(down_revision)}
|
||
depends_on: Union[str, None] = None
|
||
|
||
|
||
def upgrade() -> None:
|
||
"""${message}."""
|
||
# Use ``op.batch_alter_table()`` for SQLite compatibility.
|
||
# Always check whether the table/column already exists before altering
|
||
# to keep migrations idempotent (safe to re-run).
|
||
#
|
||
# Example – add a column only if it is missing:
|
||
#
|
||
# conn = op.get_bind()
|
||
# inspector = sa.inspect(conn)
|
||
# if "my_table" in inspector.get_table_names():
|
||
# existing = {c["name"] for c in inspector.get_columns("my_table")}
|
||
# if "new_col" not in existing:
|
||
# with op.batch_alter_table("my_table") as batch_op:
|
||
# batch_op.add_column(sa.Column("new_col", sa.String(128), nullable=True))
|
||
${upgrades if upgrades else "pass"}
|
||
|
||
|
||
def downgrade() -> None:
|
||
"""Reverse ${message}."""
|
||
${downgrades if downgrades else "pass"}
|