mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-03 00:31:35 -07:00
Refactor event and session column names to camelCase
- Updated test cases to reflect new column names (eve_MAC -> eveMac, eve_DateTime -> eveDateTime, etc.) across various test files. - Modified SQL table definitions in the database cleanup and migration tests to use camelCase naming conventions. - Implemented migration tests to ensure legacy column names are correctly renamed to camelCase equivalents. - Ensured that existing data is preserved during the migration process and that views referencing old column names are dropped before renaming. - Verified that the migration function is idempotent, allowing for safe re-execution without data loss.
This commit is contained in:
@@ -33,8 +33,8 @@ class WorkflowManager:
|
||||
"""Get new unprocessed events from the AppEvents table."""
|
||||
result = self.db.sql.execute("""
|
||||
SELECT * FROM AppEvents
|
||||
WHERE AppEventProcessed = 0
|
||||
ORDER BY DateTimeCreated ASC
|
||||
WHERE appEventProcessed = 0
|
||||
ORDER BY dateTimeCreated ASC
|
||||
""").fetchall()
|
||||
|
||||
mylog("none", [f"[WF] get_new_app_events - new events count: {len(result)}"])
|
||||
@@ -44,7 +44,7 @@ class WorkflowManager:
|
||||
def process_event(self, event):
|
||||
"""Process the events. Check if events match a workflow trigger"""
|
||||
|
||||
evGuid = event["GUID"]
|
||||
evGuid = event["guid"]
|
||||
|
||||
mylog("verbose", [f"[WF] Processing event with GUID {evGuid}"])
|
||||
|
||||
@@ -67,10 +67,10 @@ class WorkflowManager:
|
||||
self.db.sql.execute(
|
||||
"""
|
||||
UPDATE AppEvents
|
||||
SET AppEventProcessed = 1
|
||||
WHERE "Index" = ?
|
||||
SET appEventProcessed = 1
|
||||
WHERE "index" = ?
|
||||
""",
|
||||
(event["Index"],),
|
||||
(event["index"],),
|
||||
) # Pass the event's unique identifier
|
||||
self.db.commitDB()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user