feat: add Food Gallery category to image gallery
- Add 'food' category filter in ImageGallery component
- Add '🍽️ Food Gallery' section in sectionCategories
- Update filteredImages logic to handle food category
- Clean up duplicate logo/favicon images in database
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
-- Remove duplicate images, keeping only the most recent one per (filename, location_target, data length)
|
||||
-- This handles upload accidents where same image was uploaded multiple times
|
||||
|
||||
-- First, identify duplicates
|
||||
-- SELECT filename, location_target, COUNT(*) as dupes, array_agg(id) as ids
|
||||
-- FROM images GROUP BY filename, location_target, LENGTH(data) HAVING COUNT(*) > 1;
|
||||
|
||||
-- Delete duplicates, keeping the latest (highest id) per group
|
||||
DELETE FROM images a
|
||||
USING images b
|
||||
WHERE a.id < b.id
|
||||
AND a.filename = b.filename
|
||||
AND a.location_target = b.location_target
|
||||
AND LENGTH(a.data) = LENGTH(b.data);
|
||||
|
||||
-- Verify cleanup
|
||||
SELECT filename, location_target, COUNT(*) as count
|
||||
FROM images
|
||||
GROUP BY filename, location_target, LENGTH(data)
|
||||
HAVING COUNT(*) > 1;
|
||||
Reference in New Issue
Block a user