feat(reporting): Implement 'Report Mistake' feature with API and UI [2f388f42]

This commit is contained in:
2026-01-27 09:00:20 +00:00
parent 5908c2e403
commit cb63df28af
6 changed files with 520 additions and 13 deletions

View File

@@ -69,6 +69,26 @@ def migrate_tables():
logger.info(f"Adding column '{col}' to 'companies' table...")
cursor.execute(f"ALTER TABLE companies ADD COLUMN {col} {col_type}")
# 3. Create REPORTED_MISTAKES Table
logger.info("Checking 'reported_mistakes' table schema...")
cursor.execute("""
CREATE TABLE IF NOT EXISTS reported_mistakes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
company_id INTEGER NOT NULL,
field_name TEXT NOT NULL,
wrong_value TEXT,
corrected_value TEXT,
source_url TEXT,
quote TEXT,
user_comment TEXT,
status TEXT NOT NULL DEFAULT 'PENDING',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (company_id) REFERENCES companies (id)
)
""")
logger.info("Table 'reported_mistakes' ensured to exist.")
conn.commit()
logger.info("All migrations completed successfully.")