diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2023-06-22 00:14:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-22 00:14:01 +0300 |
commit | 8e8531d402b4038c12dfb73431559082787ebaa8 (patch) | |
tree | c57b4ab494ea731407fc3d8ef4bf7dea094d2850 /database | |
parent | c980f48ddad30002170c06d1ae106bf73b40e9bd (diff) |
Create index for health log migration (#15233)
Create health_log_id index
Diffstat (limited to 'database')
-rw-r--r-- | database/sqlite/sqlite_db_migration.c | 2 | ||||
-rw-r--r-- | database/sqlite/sqlite_functions.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/database/sqlite/sqlite_db_migration.c b/database/sqlite/sqlite_db_migration.c index 50c0837672..11d368f5b7 100644 --- a/database/sqlite/sqlite_db_migration.c +++ b/database/sqlite/sqlite_db_migration.c @@ -244,6 +244,8 @@ static int do_migration_v8_v9(sqlite3 *database, const char *name) sqlite3_exec_monitored(database, sql, 0, 0, NULL); snprintfz(sql, 2047, "CREATE INDEX IF NOT EXISTS health_log_d_ind_3 ON health_log_detail (transition_id);"); sqlite3_exec_monitored(database, sql, 0, 0, NULL); + snprintfz(sql, 2047, "CREATE INDEX IF NOT EXISTS health_log_d_ind_4 ON health_log_detail (health_log_id);"); + sqlite3_exec_monitored(database, sql, 0, 0, NULL); snprintfz(sql, 2047, "ALTER TABLE alert_hash ADD source text;"); sqlite3_exec_monitored(database, sql, 0, 0, NULL); diff --git a/database/sqlite/sqlite_functions.c b/database/sqlite/sqlite_functions.c index 3f6b5bb6f5..88fd6cf3c5 100644 --- a/database/sqlite/sqlite_functions.c +++ b/database/sqlite/sqlite_functions.c @@ -61,6 +61,7 @@ const char *database_config[] = { "CREATE INDEX IF NOT EXISTS health_log_d_ind_1 ON health_log_detail (unique_id);", "CREATE INDEX IF NOT EXISTS health_log_d_ind_2 ON health_log_detail (global_id);", "CREATE INDEX IF NOT EXISTS health_log_d_ind_3 ON health_log_detail (transition_id);", + "CREATE INDEX IF NOT EXISTS health_log_d_ind_4 ON health_log_detail (health_log_id);", //TODO more indexes NULL |