memos/store/db/migration/prod/0.8/01__memo_relation.sql
2022-11-19 09:57:54 +08:00

12 lines
380 B
SQL

-- memo_relation
CREATE TABLE memo_relation (
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
memo_id INTEGER NOT NULL,
related_memo_id INTEGER NOT NULL,
type TEXT NOT NULL,
description TEXT NOT NULL DEFAULT '',
UNIQUE(memo_id, related_memo_id, type)
);