- Copies each image's stored tagger predictions into the new
- image_prediction table (the source the suggestions and
- allowlist now read from). Run this once after the
- upgrade so existing images get their suggestions back — newly tagged
- images populate it automatically. Batched, resumable and idempotent;
- safe to run more than once and to leave running in the background.
-
- Removes stored tagger predictions below the current store floor
- ({{ floorPct }}) from every image, and clamps any
- allowlist threshold below the floor up to it. This is what shrinks the
- database — the low-confidence tail was the bulk of its size. Idempotent
- and resumable; safe to run more than once. Afterward, reclaim the freed
- space with VACUUM FULL / pg_repack on
- image_record.
-