-- First, drop the unique constraint if it exists
ALTER TABLE cash_denominations
DROP INDEX IF EXISTS unique_country_value;

-- Create a new unique constraint that includes denomination_type
ALTER TABLE cash_denominations
ADD UNIQUE KEY unique_denomination (country_code, denomination_value, denomination_type);

-- Insert default PHP denominations
INSERT INTO cash_denominations (country_code, denomination_type, denomination_value, denomination_name, sort_order) VALUES
-- Bills (highest to lowest)
('PHP', 'bill', 1000.00, '₱1000 Bill', 1),
('PHP', 'bill', 500.00, '₱500 Bill', 2),
('PHP', 'bill', 200.00, '₱200 Bill', 3),
('PHP', 'bill', 100.00, '₱100 Bill', 4),
('PHP', 'bill', 50.00, '₱50 Bill', 5),
('PHP', 'bill', 20.00, '₱20 Bill', 6),

-- Coins (highest to lowest)
('PHP', 'coin', 20.00, '₱20 Coin', 7),
('PHP', 'coin', 10.00, '₱10 Coin', 8),
('PHP', 'coin', 5.00, '₱5 Coin', 9),
('PHP', 'coin', 1.00, '₱1 Coin', 10); 