<?php defined('BASEPATH') or exit('No direct script access allowed');

$CI = &get_instance();

if (!$CI->db->table_exists(db_prefix() . 'gift_policy_statements')) {
    $CI->db->query('CREATE TABLE `' . db_prefix() . "gift_policy_statements` (
        `id` INT(11) NOT NULL AUTO_INCREMENT,
        `staff_id` INT(11) NOT NULL,
        `staff_name` VARCHAR(191) NULL,
        `staff_code` VARCHAR(50) NULL,
        `position` VARCHAR(191) NULL,
        `department` VARCHAR(191) NULL,
        `signature` VARCHAR(191) NOT NULL,
        `signed_date` DATE NOT NULL,
        `created_at` DATETIME NULL,
        `updated_at` DATETIME NULL,
        PRIMARY KEY (`id`),
        KEY `staff_id` (`staff_id`),
        KEY `signed_date` (`signed_date`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;");
}
if (function_exists('add_option')) {
    if (get_option('gps_notify_role_ids') === null) {
        add_option('gps_notify_role_ids', '');
    }
    if (get_option('gps_notify_staff_ids') === null) {
        add_option('gps_notify_staff_ids', '');
    }
}
