1 contributor
35 lines | 1.025kb

Table: host_flags

Stores extensible boolean/string flags for hosts without adding one column per flag to hosts.

Columns

Column Type Null Default Notes
host_fqdn TEXT no none Target host. References hosts(fqdn).
flag TEXT no none Flag name.
value TEXT no '1' Flag value.
created_at TEXT no none ISO UTC creation timestamp.
updated_at TEXT no none ISO UTC update timestamp.

Keys And Indexes

  • Primary key: (host_fqdn, flag)

Relationships

  • host_fqdn references hosts(fqdn) with ON UPDATE CASCADE ON DELETE RESTRICT

Definition

CREATE TABLE IF NOT EXISTS host_flags (
    host_fqdn TEXT NOT NULL,
    flag TEXT NOT NULL,
    value TEXT NOT NULL DEFAULT '1',
    created_at TEXT NOT NULL,
    updated_at TEXT NOT NULL,
    PRIMARY KEY (host_fqdn, flag),
    FOREIGN KEY (host_fqdn) REFERENCES hosts(fqdn) ON UPDATE CASCADE ON DELETE RESTRICT
);