mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-31 07:12:23 -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:
@@ -16,6 +16,7 @@ from db.db_upgrade import (
|
||||
ensure_Settings,
|
||||
ensure_Indexes,
|
||||
ensure_mac_lowercase_triggers,
|
||||
migrate_to_camelcase,
|
||||
migrate_timestamps_to_utc,
|
||||
)
|
||||
|
||||
@@ -194,6 +195,10 @@ class DB:
|
||||
if not ensure_column(self.sql, "Devices", "devCanSleep", "INTEGER"):
|
||||
raise RuntimeError("ensure_column(devCanSleep) failed")
|
||||
|
||||
# CamelCase column migration (must run before UTC migration and
|
||||
# before ensure_plugins_tables which uses IF NOT EXISTS with new names)
|
||||
migrate_to_camelcase(self.sql)
|
||||
|
||||
# Settings table setup
|
||||
ensure_Settings(self.sql)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user