<?php

class ModelPaymentUseepay extends Model
{

    public function install()
    {
        // create order id map table
        $this->db->query("
			CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "useepay_order_map` (
				`id` INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
				`order_id` int(11) NOT NULL,
				`useepay_order_id` varchar(64) NOT NULL,
				`create_at` DATETIME NOT NULL,
				`update_at` DATETIME NOT NULL
			) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
		");
    }

    public function uninstall()
    {
        // drop order id map table
        $this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "useepay_order_map`;");
    }
}
