amber-backend/pb_migrations
Claude fb9abaae17 Drop the 18+ account flag, its rule clause and the web page's 18+ field
Nothing read `users.nsfwEnabled` any more. `/api/amber/whoami` stopped returning
it, `GET /api/update/manifest` always answers `clean`, and the `releases` read
rule stopped mentioning it in migration 1793000000, when the nine 18+ rows (437
MB) were deleted. What was left was a per-account flag nobody writes and nobody
reads, sitting on the family's accounts and showing up in every schema dump and
access-rule review as if it still gated something. A flag that looks like a
protection but protects nothing costs the next reader the work of proving it dead.

One live reader did remain: pb_public/index.html showed a "Zdroj 18+" source
field and wrote `adultAddonUrl` into the encrypted addon config for a flagged
account, and picked a different child-profile label for one. Both are gone, so
the page offers the same three sources to everyone.

Migration 1797000000 drops the field, rewrites users.updateRule to
`id = @request.auth.id` (the clause it loses guarded a field that no longer
exists), and removes `adult` from releases.variant's allowed values. Checked
before writing it: 15 release rows, every one `clean`; three accounts carried the
flag (the owner's, one family member's, the retired test account); the separate
18+ app has no accounts and no PocketBase, so nothing outside Amber reads it.

`variant` itself stays and stays required: every installed Amber compares it
against its own build and refuses a mismatch SILENTLY, so dropping the field
would strand those installs with no error to see. publish-release.sh now accepts
only `clean`.

The status dashboard stops listing `adult-stremio-addon` and `stripchat-proxy`.
Both still run on the VPS; they are the owner's, not Amber's, and Amber never
reached them.

scripts/verify.py asserts the flag stays gone (field absent, no rule mentions it,
updateRule own-record-only). Run against a local PocketBase built from origin/main
it failed on exactly those three checks; with this migration applied, ALL CHECKS
PASSED.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 20:32:02 +02:00
..
1752600000_init_accounts_schema.js feat: PocketBase backend + account/profile schema (epic #6, issue #9) 2026-07-15 20:22:45 +02:00
1784250000_sync_fields.js feat(schema): fields the client needs to sync watch state / watchlist / prefs 2026-07-17 16:20:38 +02:00
1785200000_addon_config.js feat(schema): encrypted addon-config collection (issue #20) 2026-07-18 02:14:40 +02:00
1786000000_device_auth.js feat(device-auth): codeless device sign-in backend (#12) 2026-07-19 14:36:15 +02:00
1786500000_releases.js Fix auto-update file gating: mark releases.file protected (#16) 2026-07-20 11:48:07 +02:00
1786500001_releases_protect_file.js Fix auto-update file gating: mark releases.file protected (#16) 2026-07-20 11:48:07 +02:00
1787000000_profile_max_rating.js Add profiles.maxRating for per-profile content tiers (#14) 2026-07-21 20:42:40 +02:00
1787500000_onboarding_template.js Family onboarding site: invite-gated signup, template config, /get/tv 2026-07-22 18:23:05 +02:00
1788000000_client_logs.js Add client_logs collection for background device diagnostics (feedback 2 §4) 2026-07-23 11:49:04 +02:00
1788500000_client_logs_flavor.js client_logs: add flavor, which PocketBase was silently discarding 2026-08-06 06:45:48 +02:00
1789000000_owner_created_accounts.js Accounts are owner-created, and one page manages the whole account 2026-08-07 01:54:25 +02:00
1789000001_users_rating_default.js Accounts are owner-created, and one page manages the whole account 2026-08-07 01:54:25 +02:00
1789500000_client_logs_tester.js client_logs.tester: mark our own sessions, not the family's 2026-08-08 20:54:12 +02:00
1790000000_client_logs_gitsha.js Dashboard: read the reports, and create accounts without the admin UI 2026-08-08 23:29:51 +02:00
1790500000_providers.js Tell a new viewer what to buy before asking them to fill in a form 2026-08-12 18:36:55 +02:00
1790500001_users_onboarding.js Tell a new viewer what to buy before asking them to fill in a form 2026-08-12 18:36:55 +02:00
1791000000_onboarding_template_codes.js The code has to choose the template, not the clock 2026-08-12 21:35:46 +02:00
1791500000_notices.js Let the owner tell the family what is broken 2026-08-15 20:12:57 +02:00
1792000000_session_lifetime.js Keep a television signed in across a holiday 2026-08-29 02:09:55 +02:00
1793000000_releases_drop_adult_rule.js Drop the nsfwEnabled clause from the releases read rule 2026-08-30 04:15:50 +02:00
1793500000_notices_autodate.js notices: add the created/updated fields everything sorts by 2026-09-02 22:10:31 +02:00
1794000000_czech_mail_templates.js Czech account emails, and a reset that finishes on our own domain 2026-09-05 19:04:50 +02:00
1794500000_verify_link_to_web.js Finish confirming an email address on our own site 2026-09-05 19:31:51 +02:00
1795000000_benchmark_clips.js Hold the decode ladder the benchmark plays 2026-09-05 20:58:14 +02:00
1796000000_e2e_runs.js Show what the release gate found, run by run 2026-09-10 01:04:54 +02:00
1796500000_e2e_runs_progress.js Show a run while it is running 2026-09-10 11:37:20 +02:00
1796600000_e2e_runs_updated.js Give a run a timestamp for when it last moved 2026-09-10 11:44:07 +02:00
1797000000_drop_nsfw_enabled.js Drop the 18+ account flag, its rule clause and the web page's 18+ field 2026-09-17 20:32:02 +02:00