big dev changes

This commit is contained in:
Mateusz Gruszczyński
2026-07-21 10:11:57 +02:00
parent 4bb92a343b
commit 0b4b1753a0
23 changed files with 690 additions and 51 deletions
@@ -0,0 +1,7 @@
ALTER TABLE notes ADD COLUMN protected BOOLEAN NOT NULL DEFAULT FALSE;
CREATE TABLE note_files (
id BIGSERIAL PRIMARY KEY, note_id BIGINT NOT NULL REFERENCES notes(id) ON DELETE CASCADE, filename TEXT NOT NULL, url TEXT NOT NULL UNIQUE,
mime_type TEXT NOT NULL, size_bytes BIGINT NOT NULL, created_at TEXT NOT NULL DEFAULT (CURRENT_TIMESTAMP::text),
is_attached BOOLEAN NOT NULL DEFAULT TRUE, detached_at TEXT
);
CREATE INDEX idx_note_files_note ON note_files(note_id, id DESC);