-- Add TPIN security columns to company_settings
-- Safe to run once against erp_foundation

ALTER TABLE `company_settings`
    ADD COLUMN `tpin_enabled` TINYINT(1) NOT NULL DEFAULT 1 AFTER `fiscal_year_start_month`,
    ADD COLUMN `tpin_required_by_default` TINYINT(1) NOT NULL DEFAULT 0 AFTER `tpin_enabled`,
    ADD COLUMN `tpin_max_failed_attempts` TINYINT UNSIGNED NOT NULL DEFAULT 5 AFTER `tpin_required_by_default`,
    ADD COLUMN `tpin_lockout_minutes` SMALLINT UNSIGNED NOT NULL DEFAULT 15 AFTER `tpin_max_failed_attempts`;
