-- Withdrawal methods API now returns pid (method id) and icon_id (for icons).
-- Map: api pid -> pid, api icon_id -> icon_id. Remove way_id.
ALTER TABLE `crypto_withdrawal_methods`
  ADD COLUMN `icon_id` VARCHAR(20) NOT NULL DEFAULT '' COMMENT 'Icon ID from API for icon filename' AFTER `network`,
  DROP INDEX `ix_way_id`,
  DROP COLUMN `way_id`;

-- Replace V41 seed rows with new structure (pid = method id, icon_id = icon filename)
DELETE FROM `crypto_withdrawal_methods`;

-- Seed initial methods (pid from API, icon_id for icon filename)
INSERT INTO `crypto_withdrawal_methods` (`pid`, `name`, `network`, `icon_id`, `min_withdrawal`) VALUES
(1, 'LTC', 'Litecoin', '30', 0.10),
(2, 'BNB', 'BNB', '130', 0.10),
(3, 'TRX', 'TRON', '90', 0.10),
(4, 'TON', 'Toncoin', '235', 0.10);
