CREATE TABLE bank_age_policies (
    id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    bank_id INT UNSIGNED NOT NULL,
    min_age TINYINT UNSIGNED NOT NULL,
    max_age TINYINT UNSIGNED NULL,
    status ENUM(''ativo'',''inativo'') NOT NULL DEFAULT ''ativo'',
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    CONSTRAINT uniq_bank_age_policies_bank UNIQUE (bank_id),
    CONSTRAINT fk_bank_age_policies_bank FOREIGN KEY (bank_id) REFERENCES bank_catalog (id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
