feat: initial commit
This commit is contained in:
3
migrations/sqlite/0000000_init.down.sql
Normal file
3
migrations/sqlite/0000000_init.down.sql
Normal file
@ -0,0 +1,3 @@
|
||||
DROP TABLE specs;
|
||||
|
||||
DROP TABLE agents;
|
21
migrations/sqlite/0000000_init.up.sql
Normal file
21
migrations/sqlite/0000000_init.up.sql
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
|
||||
CREATE TABLE agents (
|
||||
id INTEGER PRIMARY KEY,
|
||||
remote_id TEXT NOT NULL UNIQUE,
|
||||
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
|
||||
);
|
Reference in New Issue
Block a user