Files
CyyNote/cyynote-backend/target/classes/db/migrations/V4__backfill_note_userid.sql
T
2026-05-15 19:01:10 +08:00

6 lines
301 B
SQL

-- V4: Assign existing notes without an owner to userid=1 (first admin)
-- This ensures production data created before multi-user isolation is not lost.
UPDATE note SET userid = 1 WHERE userid IS NULL OR userid = 0;
INSERT OR IGNORE INTO db_version (version, applied_at) VALUES (4, datetime('now'));