- Removed manual refresh button from frontend (kept auto-refresh functionality) - Fixed WebKit 'object cannot be found' error by replacing absolute positioning with flexbox - Added lazy loading to images to prevent preload warnings - Cleaned up unused imports and variables: - Removed unused useRef import - Removed unused colors state variable and colorService - Removed unused ColorSwatch import from FilamentTableV2 - Removed unused getModifierIcon function from MaterialBadge - Updated tests to match current implementation - Improved layout stability for better cross-browser compatibility - Removed temporary migration scripts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
56 lines
1.4 KiB
SQL
56 lines
1.4 KiB
SQL
-- Add 1 refill and 1 spulna for each color as PLA Basic filaments
|
|
-- Run this with: psql $DATABASE_URL -f scripts/add-basic-refills.sql
|
|
|
|
-- First show what colors we have
|
|
SELECT name, hex FROM colors ORDER BY name;
|
|
|
|
-- Insert PLA Basic filaments with 1 refill and 1 spulna for each color that doesn't already have one
|
|
INSERT INTO filaments (tip, finish, boja, boja_hex, refill, spulna, kolicina, cena)
|
|
SELECT
|
|
'PLA' as tip,
|
|
'Basic' as finish,
|
|
c.name as boja,
|
|
c.hex as boja_hex,
|
|
1 as refill,
|
|
1 as spulna,
|
|
2 as kolicina, -- 1 refill + 1 spulna
|
|
'3999' as cena
|
|
FROM colors c
|
|
WHERE NOT EXISTS (
|
|
SELECT 1 FROM filaments f
|
|
WHERE f.tip = 'PLA'
|
|
AND f.finish = 'Basic'
|
|
AND f.boja = c.name
|
|
)
|
|
ON CONFLICT DO NOTHING;
|
|
|
|
-- Update any existing PLA Basic filaments to have 1 refill and 1 spulna
|
|
UPDATE filaments
|
|
SET refill = 1,
|
|
spulna = 1,
|
|
kolicina = 2 -- Update quantity to reflect 1 refill + 1 spulna
|
|
WHERE tip = 'PLA'
|
|
AND finish = 'Basic'
|
|
AND (refill = 0 OR spulna = 0);
|
|
|
|
-- Show summary
|
|
SELECT
|
|
'Total PLA Basic filaments with refills and spulna' as description,
|
|
COUNT(*) as count
|
|
FROM filaments
|
|
WHERE tip = 'PLA'
|
|
AND finish = 'Basic'
|
|
AND refill = 1
|
|
AND spulna = 1;
|
|
|
|
-- Show all PLA Basic filaments
|
|
SELECT
|
|
boja as color,
|
|
refill,
|
|
spulna,
|
|
kolicina as quantity,
|
|
cena as price
|
|
FROM filaments
|
|
WHERE tip = 'PLA'
|
|
AND finish = 'Basic'
|
|
ORDER BY boja; |