Files
ds-galo/backend/migrations/sqlite/000008_photo_edit_copy_bindings.up.sql
T
iu 8dd8cb6f0c fix(photos): копия фото не наследует отредактированную версию
Clone переносил все привязки photo_objects, включая роли edit*, хотя
правка принадлежит фото, чьи правки её породили. Теперь копия делит
только обычные варианты и показывается в исходном виде.

- EditRoles() и IsEditRole() в edit_render.go — единый список ролей;
- фильтр edit-ролей в Store.Clone и SQLiteStore.Clone;
- миграции 000016 (Postgres) и 000008 (SQLite) убирают привязки у
  копий, созданных до фикса;
- контрактная проверка копирования, сервисные и e2e-тесты.
2026-10-21 21:01:33 +03:00

11 lines
501 B
SQL

-- The edited version belongs to the photo whose edits produced it. Copies made
-- before the fix still carried the edit bindings, so a photo without edit
-- parameters showed the edited picture. Drop those bindings: the objects
-- become collectable garbage and the copies show the original picture again.
DELETE FROM photo_objects
WHERE role IN ('edit', 'edit_thumb', 'edit_medium', 'edit_preview')
AND photo_id IN (
SELECT id FROM photos WHERE edit_params IS NULL OR edit_params = '{}'
);