-- Moves the hardcoded $blockedNames list out of import_csv.php's source
-- code and into a real table. Two reasons: (1) it lets employee deletion
-- add a name to the block list at runtime -- having a delete action
-- rewrite a PHP source file on disk would be fragile, and most
-- production hosts don't even allow the web server to write to its own
-- PHP files for good security reasons; (2) it makes the current list
-- (previously invisible unless you opened the source file) manageable
-- like any other data.
--
-- Names are stored lowercase and compared lowercase, matching the exact
-- normalization import_csv.php already does to incoming CSV names.
--
-- Safe to run more than once.

CREATE TABLE IF NOT EXISTS `blocked_import_names` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(255) NOT NULL,
    `reason` VARCHAR(255) DEFAULT NULL,
    `created_at` TIMESTAMP NOT NULL DEFAULT current_timestamp(),
    PRIMARY KEY (`id`),
    UNIQUE KEY `uniq_blocked_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT IGNORE INTO `blocked_import_names` (`name`, `reason`) VALUES
    ('abigail adunoye', 'Pre-existing block list'),
    ('dorgu josphine', 'Pre-existing block list'),
    ('edidiong okon', 'Pre-existing block list'),
    ('emeka onwuasor', 'Pre-existing block list'),
    ('etimbuk christopher', 'Pre-existing block list'),
    ('etini eriti', 'Pre-existing block list'),
    ('felix ighose', 'Pre-existing block list'),
    ('happines orlu', 'Pre-existing block list'),
    ('favour adema', 'Pre-existing block list'),
    ('irene david', 'Pre-existing block list'),
    ('janet anagbara', 'Pre-existing block list'),
    ('nicholas taiwo', 'Pre-existing block list'),
    ('david ogunniran', 'Pre-existing block list'),
    ('orus ebimotimi anita', 'Pre-existing block list'),
    ('ignatious aneh', 'Pre-existing block list'),
    ('philip oluwasheyi', 'Pre-existing block list'),
    ('chinyere anyalewechi', 'Pre-existing block list'),
    ('sarah w agada', 'Pre-existing block list'),
    ('stephen richard', 'Pre-existing block list'),
    ('tijani enizbe', 'Pre-existing block list'),
    ('tomudo gift', 'Pre-existing block list'),
    ('johnson ebi', 'Pre-existing block list'),
    ('etim anthony efoli', 'Pre-existing block list'),
    ('victor efoagui', 'Pre-existing block list'),
    ('david macafebo', 'Pre-existing block list'),
    ('blessing anthony', 'Pre-existing block list'),
    ('favour kelvin', 'Pre-existing block list'),
    ('francis sunday', 'Pre-existing block list'),
    ('alexander joseph', 'Pre-existing block list'),
    ('glory young', 'Pre-existing block list'),
    ('godbless emurarshe', 'Pre-existing block list'),
    ('ikeke kaidew', 'Pre-existing block list'),
    ('olamide afolabi', 'Pre-existing block list'),
    ('victor williams', 'Pre-existing block list'),
    ('unknown', 'Pre-existing block list'),
    ('null', 'Pre-existing block list');
