-- Store currency defaults to INR instead of USD, across every table that
-- carries a currency code — new rows created without an explicit currency
-- (cart, checkout, order, payment, product, product variant, shipping rate)
-- now land on INR by default, matching the storefront's own INR-only
-- pricing. Existing rows still tagged 'USD' from before this change are
-- backfilled too, since this is demo/seed data, not real historical
-- multi-currency transactions.

ALTER TABLE products.products ALTER COLUMN "currency" SET DEFAULT 'INR';
ALTER TABLE store.stores ALTER COLUMN "defaultCurrency" SET DEFAULT 'INR';
ALTER TABLE products.product_variants ALTER COLUMN "currency" SET DEFAULT 'INR';
ALTER TABLE cart.carts ALTER COLUMN "currency" SET DEFAULT 'INR';
ALTER TABLE cart.checkout_sessions ALTER COLUMN "currency" SET DEFAULT 'INR';
ALTER TABLE sales.orders ALTER COLUMN "currency" SET DEFAULT 'INR';
ALTER TABLE sales.payments ALTER COLUMN "currency" SET DEFAULT 'INR';
ALTER TABLE store.shipping_rates ALTER COLUMN "currency" SET DEFAULT 'INR';

UPDATE products.products SET "currency" = 'INR' WHERE "currency" = 'USD';
UPDATE store.stores SET "defaultCurrency" = 'INR' WHERE "defaultCurrency" = 'USD';
UPDATE products.product_variants SET "currency" = 'INR' WHERE "currency" = 'USD';
UPDATE cart.carts SET "currency" = 'INR' WHERE "currency" = 'USD';
UPDATE cart.checkout_sessions SET "currency" = 'INR' WHERE "currency" = 'USD';
UPDATE sales.orders SET "currency" = 'INR' WHERE "currency" = 'USD';
UPDATE sales.payments SET "currency" = 'INR' WHERE "currency" = 'USD';
UPDATE store.shipping_rates SET "currency" = 'INR' WHERE "currency" = 'USD';
