mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-11 17:29:37 +02:00
fix: add missing parent_id and level columns for subtasks support
ROOT CAUSE: During phases 1-5, subtask support was added which requires parent_id and level columns in note_todos and global_todos tables. However, the auto-migrate script did not include this migration, causing 500 errors when the API tried to SELECT these non-existent columns. Changes: - scripts/auto-migrate.js: Added Migration 4 to create parent_id and level columns if they don't exist - config/database.js: Updated CREATE TABLE statements to include parent_id and level columns in the initial schema This fixes the 500 error on GET /api/notes that occurred because the code was trying to SELECT columns that didn't exist in production. The migration will run automatically on next Docker startup and add the missing columns without data loss. Fixes: "je n ai plus aucune note qui s affichent" - notes not displaying
This commit is contained in:
2 files changed
+53
No files matched your search
@@ -126,6 +126,8 @@ async function initDatabase() {
|
||||
completed BOOLEAN DEFAULT FALSE,
|
||||
priority BOOLEAN DEFAULT FALSE,
|
||||
position INTEGER DEFAULT 0,
|
||||
parent_id INTEGER REFERENCES note_todos(id) ON DELETE CASCADE,
|
||||
level INTEGER DEFAULT 0,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
completed_at TIMESTAMP
|
||||
)
|
||||
@@ -140,6 +142,8 @@ async function initDatabase() {
|
||||
completed BOOLEAN DEFAULT FALSE,
|
||||
priority BOOLEAN DEFAULT FALSE,
|
||||
in_progress INTEGER DEFAULT 0,
|
||||
parent_id INTEGER REFERENCES global_todos(id) ON DELETE CASCADE,
|
||||
level INTEGER DEFAULT 0,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
completed_at TIMESTAMP
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user