Initial template for registration service

This commit is contained in:
2026-07-24 07:02:09 +02:00
parent 44a4b279bb
commit 5f94ae3b68
5 changed files with 491 additions and 1 deletions
@@ -0,0 +1,20 @@
CREATE TABLE "service" (
id INTEGER PRIMARY KEY,
cluster VARCHAR(255) NOT NULL,
hostname VARCHAR(255) NOT NULL,
service_type VARCHAR(255) NOT NULL,
instance_id VARCHAR(64) NOT NULL,
state VARCHAR(32) NOT NULL DEFAULT 'pending'
CHECK (state IN ('pending', 'active', 'stale', 'deregistered')),
registered_at INTEGER NOT NULL,
last_heartbeat INTEGER,
config_revision INTEGER NOT NULL DEFAULT 0,
meta_data TEXT, -- JSON
UNIQUE (cluster, hostname, service_type),
UNIQUE (instance_id)
);
CREATE INDEX IF NOT EXISTS services_cluster ON service (cluster);
CREATE INDEX IF NOT EXISTS services_state_heartbeat ON service (state, last_heartbeat);
PRAGMA optimize;