edge/pkg/storage/driver/sqlite/document_store.sql
William Petit 8f9428b3f3
Some checks are pending
arcad/edge/pipeline/head Build started...
arcad/edge/pipeline/pr-master Build started...
feat(storage): add revision number to documents
ref #13
2024-01-12 10:05:47 +01:00

16 lines
370 B
SQL

CREATE TABLE IF NOT EXISTS documents (
id TEXT PRIMARY KEY,
collection TEXT NOT NULL,
data TEXT,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
UNIQUE(id, collection) ON CONFLICT REPLACE
);
---
CREATE INDEX IF NOT EXISTS collection_idx ON documents (collection);
---
ALTER TABLE documents ADD COLUMN revision INTEGER DEFAULT 0;