feat: backdated reported date for old active tickets #7

Merged
abiba-bot merged 2 commits from fm/denya-backdate-report-date into main 2026-08-03 09:59:07 +00:00
Showing only changes of commit fb0c1784d0 - Show all commits
+8
View File
@@ -38,6 +38,14 @@ async def ensure_legacy_schema(conn) -> None:
text("ALTER TABLE tickets ADD COLUMN phone VARCHAR(50)") text("ALTER TABLE tickets ADD COLUMN phone VARCHAR(50)")
) )
logger.info("Added missing tickets.phone column (legacy database)") logger.info("Added missing tickets.phone column (legacy database)")
if "reported_at" not in ticket_columns:
await conn.execute(
text("ALTER TABLE tickets ADD COLUMN reported_at DATETIME")
)
await conn.execute(
text("UPDATE tickets SET reported_at = created_at WHERE reported_at IS NULL")
)
logger.info("Added missing tickets.reported_at column (legacy database)")
result = await conn.execute( result = await conn.execute(
text( text(
"UPDATE categories SET name = 'Missing Item' " "UPDATE categories SET name = 'Missing Item' "