Commit Graph

3 Commits

Author SHA1 Message Date
altair823
5bcfd26bfd feat(trash): migration v3 + Note type extension (#4 v0.2.3)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 20:32:52 +09:00
altair823
0bb6c12bbb feat(db): migration v2 — due_date columns + pre-migration snapshot
ALTER TABLE notes adds due_date TEXT + due_date_edited_by_user INTEGER.
openDb takes <dbFile>.pre-v<N>.bak before running migrations
(F6-L1 follow-up #4 — preserves recoverable state if migration fails).
NoteRepository: updateAiResult accepts dueDate?, setDueDate +
edited-flag CASE WHEN guard mirroring title/summary pattern.
Note interface gains dueDate + dueDateEditedByUser fields.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 11:05:44 +09:00
altair823
114e971518 feat(db): v1 schema with user_intent + edited flags
Task 6 of the slice plan. Adds the initial database surface:
- m001_initial: notes (with v0.2 columns user_intent,
  intent_prompted_at, title_edited_by_user,
  summary_edited_by_user), tags, note_tags (with source ai/user),
  media, pending_jobs.
- migrations/index: forward-only PRAGMA user_version runner that
  applies pending migrations inside a single transaction.
- db/index: openDb() that opens better-sqlite3, enables WAL +
  foreign_keys, then runs migrations.
- migrations.test: schema columns are present at v1; runMigrations
  is idempotent.

Verification: `npx vitest run tests/unit/migrations.test.ts`
2 passed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 12:02:04 +09:00