Adds pHash + dHash columns alongside the existing blake3 content_hash so
near-duplicates (re-encoded, resized, format-converted copies) become
queryable. /duplicates/{exact,perceptual} return groups; /duplicates/
{resolve,unresolve} flip a duplicate_of_hash soft-mark on losing rows
and union perceptual-only tag sets onto the survivor. The default
/photos listing filters duplicate_of_hash IS NULL so demoted siblings
stop cluttering the grid; include_duplicates=true opts back in for
Apollo's review modal. Upload now hashes bytes pre-write and returns
409 with the canonical sibling when a file's bytes already exist.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9 lines
343 B
SQL
9 lines
343 B
SQL
DROP INDEX IF EXISTS idx_image_exif_duplicate_of_hash;
|
|
DROP INDEX IF EXISTS idx_image_exif_dhash;
|
|
DROP INDEX IF EXISTS idx_image_exif_phash;
|
|
|
|
ALTER TABLE image_exif DROP COLUMN duplicate_decided_at;
|
|
ALTER TABLE image_exif DROP COLUMN duplicate_of_hash;
|
|
ALTER TABLE image_exif DROP COLUMN dhash_64;
|
|
ALTER TABLE image_exif DROP COLUMN phash_64;
|