host_aliasesStores aliases for canonical hosts. Aliases are retained after retirement for audit and collision prevention.
| Column | Type | Null | Default | Notes |
|---|---|---|---|---|
alias_name |
TEXT |
no | none | Alias DNS name or short alias. |
host_fqdn |
TEXT |
no | none | Target host. References hosts(fqdn). |
alias_kind |
TEXT |
no | 'declared' |
declared, derived, or derived-vhost. |
status |
TEXT |
no | 'active' |
Alias lifecycle state. |
is_dns_published |
INTEGER |
no | 1 |
Whether this alias should appear in generated DNS exports. |
created_at |
TEXT |
no | none | ISO UTC creation timestamp. |
retired_at |
TEXT |
yes | NULL |
ISO UTC retirement timestamp. |
notes |
TEXT |
no | '' |
Operator notes. |
(alias_name, host_fqdn)idx_host_aliases_active_name on alias_name where status = 'active'idx_host_aliases_host_status on (host_fqdn, status)host_fqdn references hosts(fqdn) with ON UPDATE CASCADE ON DELETE RESTRICTstatus changes to retired and is_dns_published is set to 0.baobab are persisted with alias_kind = 'derived'.pmx.baobab are persisted with alias_kind = 'derived-vhost'.CREATE TABLE IF NOT EXISTS host_aliases (
alias_name TEXT NOT NULL,
host_fqdn TEXT NOT NULL,
alias_kind TEXT NOT NULL DEFAULT 'declared',
status TEXT NOT NULL DEFAULT 'active',
is_dns_published INTEGER NOT NULL DEFAULT 1,
created_at TEXT NOT NULL,
retired_at TEXT,
notes TEXT NOT NULL DEFAULT '',
PRIMARY KEY (alias_name, host_fqdn),
FOREIGN KEY (host_fqdn) REFERENCES hosts(fqdn) ON UPDATE CASCADE ON DELETE RESTRICT
);
CREATE UNIQUE INDEX IF NOT EXISTS idx_host_aliases_active_name
ON host_aliases(alias_name)
WHERE status = 'active';
CREATE INDEX IF NOT EXISTS idx_host_aliases_host_status
ON host_aliases(host_fqdn, status);