feat(notes,profile): trash for notes and personal model connection check
Notes: - soft delete via deleted_at/purge_at with trashPurgeDays(), restore and permanent-delete routes, ?deleted=1 list switch - GET /api/notes now always returns only own notes (admin included) - purge user_notes in purgeScheduledDeletions(), skip deleted rows in reorder and in the note title worker - deleted_at/purge_at in init.sql, migration.sql, ensureUserNotesTable(), normalizeRestoreData and restore-insert Profile: - POST /api/user-settings/models/test probes a personal model from the client payload (works before save), shared probeAiModel() with the admin profile test, AI_MODEL_TEST_TIMEOUT_MS env in .env.example/compose - "Проверить" button in the model list and in the model form - password fields: autocomplete hints, values cleared on every toggle Notes page: #notesDeleted trash toggle, deleted card state, restore/permanent actions; fmtTs() uses the global fmtDateTime() instead of the non-existent window.datetime.
This commit is contained in:
+4
-1
@@ -240,9 +240,12 @@ CREATE TABLE IF NOT EXISTS user_notes (
|
||||
sort_order INT NOT NULL DEFAULT 0,
|
||||
ai_status VARCHAR(20) NOT NULL DEFAULT 'none',
|
||||
created_at TIMESTAMPTZ DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ DEFAULT now()
|
||||
updated_at TIMESTAMPTZ DEFAULT now(),
|
||||
deleted_at TIMESTAMPTZ,
|
||||
purge_at TIMESTAMPTZ
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_user_notes_pending ON user_notes(ai_status, id) WHERE ai_status = 'pending';
|
||||
CREATE INDEX IF NOT EXISTS idx_user_notes_deleted ON user_notes(deleted_at);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS bookmarks (
|
||||
id SERIAL PRIMARY KEY,
|
||||
|
||||
Reference in New Issue
Block a user