mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
feat(integrations): remove the moodLog integration
Mood has been a first-class module here for a long time, with entries,
structured tags, rated factors and notes. The bridge to the external moodLog
service had nothing left to add, and its Settings card was withdrawn in
a56e6fe61 on the promise of a dedicated removal. This delivers it.
Removed: the hourly `moodlog-sync` queue, cron and handler binding; the
inbound webhook and its shared-secret handling; the reverse push and its four
call sites; the pull-sync module; the per-user credential routes and the
instance-wide toggle; the entry on the `/api/integrations/status` envelope,
the `IntegrationKey` union, the cadence map and the display-name table; the
boot-time secret rotation pass; 22 message keys per locale.
Migration 0271 drops the five `users` credential columns and
`app_settings.mood_log_global`, clears the ledger row for the provider, and
deletes the retired pg-boss schedule so no cron keeps enqueuing work no
handler drains.
Mood data is untouched. `mood_entries` is not named anywhere in the migration
and cannot be reached from it: the dropped columns carry no index, constraint
or foreign key, and `mood_entries.user_id` references `users(id)`, not any of
them. Rows the bridge imported keep `source = 'MOODLOG'`, and every read path
- list filter, source badge, exports, backups - still resolves that value.
`src/lib/validations/moodlog.ts` held the native mood-entry schemas alongside
the bridge's own; it is now `validations/mood.ts` and carries only the former.
This commit is contained in:
1 parent
4ed8c8f39b
commit
d0b45e36b3
106 files changed
+379
-3326
No files matched your search
@@ -62,11 +62,10 @@ reset to `'disconnected'`), `ai_anthropic_key_encrypted`,
|
||||
`withings_client_id_encrypted`, `withings_client_secret_encrypted`,
|
||||
`whoop_client_id_encrypted`, `whoop_client_secret_encrypted`,
|
||||
`fitbit_client_id_encrypted`, `fitbit_client_secret_encrypted`,
|
||||
`telegram_bot_token`, `telegram_chat_id`, `mood_log_url_encrypted`,
|
||||
`mood_log_api_key_encrypted`, `mood_log_webhook_secret`,
|
||||
`telegram_bot_token`, `telegram_chat_id`,
|
||||
`insurance_number_encrypted`, `insurer_name`, `insurer_ik_number`.
|
||||
|
||||
Forced flags: `telegram_enabled=false`, `mood_log_enabled=false`,
|
||||
Forced flags: `telegram_enabled=false`,
|
||||
`role='ADMIN'`.
|
||||
|
||||
**Kept:** `password_hash` (demo login works), `avatar_bytes` /
|
||||
|
||||
@@ -302,7 +302,7 @@ fi
|
||||
#
|
||||
# users — explicit ordered list. Secret/credential columns are NULLed in the
|
||||
# SELECT (literal NULL in the right position). role forced to 'ADMIN'.
|
||||
# telegram_enabled / mood_log_enabled forced false. Kept: password_hash,
|
||||
# telegram_enabled forced false. Kept: password_hash,
|
||||
# avatar_*, all display/prefs/layout JSON, unit prefs, profile fields.
|
||||
#
|
||||
# The SELECT projects literals for the NULLed/forced columns and the real
|
||||
@@ -318,8 +318,6 @@ readonly USERS_COLS="id, username, email, password_hash, role, created_at, updat
|
||||
withings_client_id_encrypted, withings_client_secret_encrypted,
|
||||
whoop_client_id_encrypted, whoop_client_secret_encrypted,
|
||||
fitbit_client_id_encrypted, fitbit_client_secret_encrypted,
|
||||
mood_log_url_encrypted, mood_log_api_key_encrypted, mood_log_enabled,
|
||||
mood_log_last_synced_at, mood_log_webhook_secret,
|
||||
locale, thresholds_json, dashboard_widgets_json, insights_layout_json,
|
||||
glucose_unit, unit_preference,
|
||||
ai_provider, ai_model, ai_base_url, ai_anthropic_key_encrypted, ai_local_key_encrypted,
|
||||
@@ -358,11 +356,6 @@ readonly USERS_SELECT="id, username, email, password_hash,
|
||||
NULL::text AS whoop_client_secret_encrypted,
|
||||
NULL::text AS fitbit_client_id_encrypted,
|
||||
NULL::text AS fitbit_client_secret_encrypted,
|
||||
NULL::text AS mood_log_url_encrypted,
|
||||
NULL::text AS mood_log_api_key_encrypted,
|
||||
false AS mood_log_enabled,
|
||||
NULL::timestamptz AS mood_log_last_synced_at,
|
||||
NULL::text AS mood_log_webhook_secret,
|
||||
locale, thresholds_json, dashboard_widgets_json, insights_layout_json,
|
||||
glucose_unit, unit_preference,
|
||||
ai_provider, ai_model, ai_base_url,
|
||||
@@ -651,7 +644,7 @@ fi
|
||||
|
||||
echo
|
||||
echo "HARD assertion 3: the demo user exists on edge01 with role=ADMIN and the apps01 id."
|
||||
psql_dst "-c \"SELECT id, username, role, telegram_enabled, mood_log_enabled FROM users WHERE id = '$DEMO_USER_ID';\""
|
||||
psql_dst "-c \"SELECT id, username, role, telegram_enabled FROM users WHERE id = '$DEMO_USER_ID';\""
|
||||
|
||||
echo
|
||||
echo "=============================================================="
|
||||
|
||||
@@ -159,8 +159,7 @@ async function main() {
|
||||
|
||||
// ───── User — integration credentials + AI keys + KVNR (String) ─────
|
||||
// Columns: "codexAccessTokenEncrypted" "codexRefreshTokenEncrypted"
|
||||
// "telegramBotToken" "moodLogWebhookSecret" "moodLogUrlEncrypted"
|
||||
// "moodLogApiKeyEncrypted" "withingsClientIdEncrypted"
|
||||
// "telegramBotToken" "withingsClientIdEncrypted"
|
||||
// "withingsClientSecretEncrypted" "whoopClientIdEncrypted"
|
||||
// "whoopClientSecretEncrypted" "fitbitClientIdEncrypted"
|
||||
// "fitbitClientSecretEncrypted" "nightscoutUrlEncrypted"
|
||||
@@ -176,9 +175,6 @@ async function main() {
|
||||
"codexAccessTokenEncrypted",
|
||||
"codexRefreshTokenEncrypted",
|
||||
"telegramBotToken",
|
||||
"moodLogWebhookSecret",
|
||||
"moodLogUrlEncrypted",
|
||||
"moodLogApiKeyEncrypted",
|
||||
"withingsClientIdEncrypted",
|
||||
"withingsClientSecretEncrypted",
|
||||
"whoopClientIdEncrypted",
|
||||
|
||||
Reference in new issue
Block a user