11 lines
464 B
SQL
11 lines
464 B
SQL
CREATE TABLE assessor_microsoft_security_baselines (
|
|
id text PRIMARY KEY CHECK (btrim(id) <> ''),
|
|
sha256 text NOT NULL UNIQUE CHECK (sha256 ~ '^[a-f0-9]{64}$'),
|
|
storage_key text NOT NULL UNIQUE CHECK (btrim(storage_key) <> ''),
|
|
imported_at timestamptz NOT NULL,
|
|
data jsonb NOT NULL CHECK (jsonb_typeof(data) = 'object')
|
|
);
|
|
|
|
CREATE INDEX assessor_microsoft_security_baselines_imported_idx
|
|
ON assessor_microsoft_security_baselines(imported_at DESC, id);
|