perf: paginate docs list, lazy thumbnails, static cache headers

This commit is contained in:
Krikorios
2026-04-18 23:42:06 +03:00
parent 86ff96816a
commit 379359be20
9 changed files with 773 additions and 71 deletions
+5
View File
@@ -16,11 +16,16 @@ def _migrate(conn):
("registry_office", "TEXT"),
("owns_properties", "BOOLEAN"),
("declared_property_count", "INTEGER"),
("image_hash", "TEXT"),
("duplicate_of", "INTEGER"),
]
for col, col_type in migrations:
if col not in existing:
conn.execute(f"ALTER TABLE documents ADD COLUMN {col} {col_type}")
conn.execute("CREATE INDEX IF NOT EXISTS idx_documents_image_hash ON documents(image_hash)")
conn.execute("CREATE INDEX IF NOT EXISTS idx_documents_request_number ON documents(request_number)")
cursor = conn.execute("PRAGMA table_info(properties)")
existing_prop = {row[1] for row in cursor.fetchall()}
migrations_prop = [