-- Add archived flag to products and user_products
ALTER TABLE IF EXISTS products
  ADD COLUMN IF NOT EXISTS archived BOOLEAN DEFAULT FALSE;

ALTER TABLE IF EXISTS user_products
  ADD COLUMN IF NOT EXISTS archived BOOLEAN DEFAULT FALSE,
  ADD COLUMN IF NOT EXISTS updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP;

-- Indexes for filtering
CREATE INDEX IF NOT EXISTS idx_products_archived ON products (archived);
CREATE INDEX IF NOT EXISTS idx_user_products_archived ON user_products (archived);

