Files
95b1838c7d wger: fix PowerSync import on upgraded databases (#3138), clearer Postgres errors, doc fixes (#3123) (#3136)
* wger: clearer Postgres connection errors in the PowerSync import, reuse SECRET_KEY, doc fixes (#3123)

- target_database_state() reports the real connection error, fails at once
  on errors waiting cannot fix (wrong password, missing role/database,
  pg_hba) and fails closed on any unexpected probe output.
- 89-powersync-run.sh reuses SECRET_KEY from /data/secrets.env, so its
  manage.py calls no longer print upstream's missing-key warning.
- README: internal Postgres hostname in the example; safe password
  characters (PowerSync does not percent-decode the URI).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* wger: treat a missing Postgres password as fatal in the import probe

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* wger: drop stale content types from the import copy before dumpdata (#3138)

Long-lived databases keep content types for models upstream deleted
(e.g. nutrition.WeightUnit), and groups still hold their permissions.
dumpdata --natural-foreign serialises those by natural key, which a
freshly migrated Postgres cannot resolve, so loaddata failed.
remove_stale_contenttypes runs on the disposable copy only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* wger: simplify the PowerSync import helpers (no behaviour change)

Inline the one-use SECRET_KEY loader, drop unreachable detail fallbacks
and redundant initialisers, tighten a comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* wger: correct the PowerSync import message after a failed loaddata

loaddata runs in one transaction, so a failure leaves the schema without
rows and the next start imports again. The old message told users to empty
a "half-populated" database, which is never needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: BirdNET-Go Addon Builder <addon-builder@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 22:12:36 +03:00
..