<?php

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

if (!$CI->db->table_exists(db_prefix() . 'zibalpayments')) {
 $CI->db->query('CREATE TABLE `' . db_prefix() . "zibalpayments` (
  `id` int(11) NOT NULL,
  `invoiceid` int(11) NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `date` date NOT NULL,
  `transactionid` mediumtext DEFAULT NULL,
  `status` int(4) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=" . $CI->db->char_set . ';');


 $CI->db->query('ALTER TABLE `' . db_prefix() . 'zibalpayments`
  ADD PRIMARY KEY (`id`);');


$CI->db->query('ALTER TABLE `' . db_prefix() . 'zibalpayments`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT');
}

