-- Run after database.sql
ALTER TABLE merchants
  ADD COLUMN transaction_password_hash VARCHAR(255) NULL AFTER password_hash,
  ADD COLUMN totp_secret VARCHAR(64) NULL AFTER transaction_password_hash,
  ADD COLUMN totp_enabled TINYINT(1) NOT NULL DEFAULT 0 AFTER totp_secret;

ALTER TABLE transactions
  ADD INDEX idx_tx_merchant_type_date (merchant_id, type, created_at);

ALTER TABLE merchant_withdrawals
  ADD INDEX idx_mw_merchant_date (merchant_id, created_at);
