noted/schema.sql
King Omar abf25b34ae major feature update: multi-note, dark mode, markdown, draw tools, D1 sync, share
- Multiple named notes with sidebar (persisted in localStorage + D1)
- Dark mode toggle, persisted
- Markdown preview toggle (Ctrl+M) with styled rendering
- Drawing: eraser tool, undo/redo (40-step stack)
- Auto-save indicator, word/char count status bar
- Export note as .txt download
- Keyboard shortcuts: Ctrl+S save, Ctrl+D draw, Ctrl+M markdown, Ctrl+Shift+N new note
- D1 backend (noted-db) with Pages Functions API for cross-device sync
- Share note: generates read-only link at /share/:token
- Updated service worker to v2, skip API routes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-19 22:13:50 +10:00

21 lines
515 B
SQL

CREATE TABLE IF NOT EXISTS notes (
id TEXT PRIMARY KEY,
user_id TEXT NOT NULL,
title TEXT NOT NULL DEFAULT '',
content TEXT NOT NULL DEFAULT '',
drawing TEXT,
font_size TEXT,
font_family TEXT,
text_color TEXT,
created_at INTEGER NOT NULL,
updated_at INTEGER NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_notes_user ON notes(user_id, updated_at DESC);
CREATE TABLE IF NOT EXISTS shares (
token TEXT PRIMARY KEY,
note_id TEXT NOT NULL,
user_id TEXT NOT NULL,
created_at INTEGER NOT NULL
);