Fixed report_summart view
This commit is contained in:
@@ -237,7 +237,14 @@ class ReportWriterSQLite(ReportWriterABC):
|
||||
datetime TEXT
|
||||
);"""
|
||||
)
|
||||
self._conn.commit()
|
||||
|
||||
# migrate report table to add report_id if needed (#731)
|
||||
if "report_id" not in sqlite_columns(self._conn, "report"):
|
||||
self._conn.cursor().execute("ALTER TABLE report ADD COLUMN report_id TEXT;")
|
||||
self._conn.commit()
|
||||
|
||||
# create report_summary view
|
||||
c.execute(
|
||||
"""
|
||||
CREATE VIEW IF NOT EXISTS report_summary AS
|
||||
@@ -259,12 +266,6 @@ class ReportWriterSQLite(ReportWriterABC):
|
||||
FROM report
|
||||
GROUP BY report_id;"""
|
||||
)
|
||||
|
||||
self._conn.commit()
|
||||
|
||||
# migrate report table to add report_id if needed (#731)
|
||||
if "report_id" not in sqlite_columns(self._conn, "report"):
|
||||
self._conn.cursor().execute("ALTER TABLE report ADD COLUMN report_id TEXT;")
|
||||
self._conn.commit()
|
||||
|
||||
def _generate_report_id(self) -> int:
|
||||
|
||||
Reference in New Issue
Block a user