From e82b78df49952ca56e48c5b16eb8e3a93a028884 Mon Sep 17 00:00:00 2001 From: Pavel Sviderski Date: Sat, 16 Nov 2024 06:43:24 +1000 Subject: [PATCH] comment DB schema --- internal/machine/store/schema.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/machine/store/schema.sql b/internal/machine/store/schema.sql index ac6316a7..84b792df 100644 --- a/internal/machine/store/schema.sql +++ b/internal/machine/store/schema.sql @@ -5,16 +5,20 @@ CREATE TABLE cluster value ANY ); +-- machines table stores the basic information of the machines in the cluster. CREATE TABLE machines ( id TEXT NOT NULL PRIMARY KEY, name TEXT AS (json_extract(info, '$.name')), + -- info is a JSON-serialized MachineInfo protobuf message. info TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(info)) ); +-- containers table stores the Uncloud-managed Docker containers created in the cluster. CREATE TABLE containers ( id TEXT NOT NULL PRIMARY KEY, + -- container is a JSON-serialized Docker container.Summary struct. container TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(container)), machine_id TEXT NOT NULL DEFAULT '', service_id TEXT AS (json_extract(container, '$.Labels."uncloud.service.id"')),