23 lines
547 B
SQL
23 lines
547 B
SQL
---
|
|
|
|
CREATE TABLE agents (
|
|
id INTEGER PRIMARY KEY,
|
|
thumbprint TEXT UNIQUE,
|
|
keyset TEXT,
|
|
metadata TEXT,
|
|
status INTEGER NOT NULL,
|
|
created_at datetime NOT NULL,
|
|
updated_at datetime NOT NULL
|
|
);
|
|
|
|
CREATE TABLE specs (
|
|
id INTEGER PRIMARY KEY,
|
|
agent_id INTEGER,
|
|
name TEXT NOT NULL,
|
|
revision INTEGER DEFAULT 0,
|
|
data TEXT,
|
|
created_at datetime NOT NULL,
|
|
updated_at datetime NOT NULL,
|
|
FOREIGN KEY (agent_id) REFERENCES agents (id) ON DELETE CASCADE,
|
|
UNIQUE(agent_id, name) ON CONFLICT REPLACE
|
|
); |