Add indexer DB schema versioning

Indexer-PiperOrigin-RevId: 782677989
This commit is contained in:
OSS-Fuzz Team
2025-07-13 16:31:22 -07:00
committed by Copybara-Service
parent 3ab94a745d
commit 65a755887a

View File

@@ -25,11 +25,15 @@
#include "absl/types/span.h"
#include "sqlite3.h"
#define SCHEMA_VERSION "1"
namespace oss_fuzz {
namespace indexer {
namespace {
const char kCreateDb[] =
"PRAGMA foreign_keys = ON;\n"
"PRAGMA user_version = " SCHEMA_VERSION
";\n"
"\n"
"CREATE TABLE IF NOT EXISTS location(\n"
" id INTEGER PRIMARY KEY,\n"