safe move + sqlite WAL + log indexes + backup with logs
- fix: imap folder names with spaces (RFC3501 quoting in move/create/select) - fix: move only deletes source after COPY + Message-ID verification in target - fix: backup endpoint hung on sqlite write locks — enable WAL + busy_timeout - perf: indexes on filter_logs(created_at, level, account_id+created_at) for fast log queries on millions of rows - feat: optional "logs mit sichern" checkbox in backup export, restore on import - UI: backup download uses fetch+blob with error display instead of location.href Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
"""add indexes on filter_logs
|
||||
|
||||
Revision ID: 3bccad0c6646
|
||||
Revises: c14c86cbc9c0
|
||||
Create Date: 2026-05-18 00:00:00.000000
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
|
||||
|
||||
revision: str = "3bccad0c6646"
|
||||
down_revision: Union[str, Sequence[str], None] = "c14c86cbc9c0"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Indizes für schnelle Log-Abfragen bei großen Tabellen.
|
||||
|
||||
Beschleunigt: ORDER BY created_at DESC, Filter nach account_id/level,
|
||||
und die kombinierte (account_id + ORDER BY created_at)-Abfrage.
|
||||
"""
|
||||
op.create_index(
|
||||
"ix_filter_logs_created_at",
|
||||
"filter_logs",
|
||||
["created_at"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
"ix_filter_logs_level",
|
||||
"filter_logs",
|
||||
["level"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
"ix_filter_logs_account_created",
|
||||
"filter_logs",
|
||||
["account_id", "created_at"],
|
||||
unique=False,
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_index("ix_filter_logs_account_created", table_name="filter_logs")
|
||||
op.drop_index("ix_filter_logs_level", table_name="filter_logs")
|
||||
op.drop_index("ix_filter_logs_created_at", table_name="filter_logs")
|
||||
Reference in New Issue
Block a user