emissary/migrations/sqlite/0000000_init.up.sql

23 lines
547 B
MySQL
Raw Normal View History

2023-02-02 10:55:24 +01:00
---
CREATE TABLE agents (
id INTEGER PRIMARY KEY,
thumbprint TEXT UNIQUE,
keyset TEXT,
metadata TEXT,
2023-02-02 10:55:24 +01:00
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,
2023-02-02 10:55:24 +01:00
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
);