-- =========================================================
-- MIGRATION: Transaction PIN
-- A separate 4-digit PIN required before any money movement,
-- distinct from the login password. CBN-standard practice.
-- =========================================================

ALTER TABLE users
    ADD COLUMN pin_hash        VARCHAR(255)     DEFAULT NULL AFTER password_hash,
    ADD COLUMN pin_set         TINYINT(1)       NOT NULL DEFAULT 0 AFTER pin_hash,
    ADD COLUMN pin_attempts    TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER pin_set,
    ADD COLUMN pin_locked_until DATETIME        DEFAULT NULL AFTER pin_attempts;
