@cryptotaxi247 / netdata-1 / commits / ebfaf8c09

Setting a DB version (to make future schema changes / migration easier) (#12249)

Stelios Fragkakis committed Feb 28, 2022 at 14:08 UTC ebfaf8c0903c16cabd3ba76d4ca802c022ce9a29
1 file changed +3
database/sqlite/sqlite_functions.c
+3
@@ -2,6 +2,8 @@
2
3 #include "sqlite_functions.h"
4
5 +#define DB_METADATA_VERSION "1"
6 +
7 const char *database_config[] = {
8 "PRAGMA auto_vacuum=incremental; PRAGMA synchronous=1 ; PRAGMA journal_mode=WAL; PRAGMA temp_store=MEMORY;",
9 "PRAGMA journal_size_limit=16777216;",
@@ -52,6 +54,7 @@ const char *database_config[] = {
54 "INSERT INTO chart_hash_map (chart_id, hash_id) values (new.chart_id, new.hash_id) "
55 "on conflict (chart_id, hash_id) do nothing; END; ",
56
57 + "PRAGMA user_version="DB_METADATA_VERSION";",
58 NULL
59 };
60