<?php

defined('BASEPATH') or exit('No direct script access allowed');
$CI = &get_instance();

if (!$CI->db->table_exists(db_prefix() . 'minutes_members')) {
$CI->db->query("
CREATE TABLE `". db_prefix() ."minutes_members` (
  `id` int(11) NOT NULL,
  `minute_id` int(11) NOT NULL,
  `first_name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(255) NOT NULL,
  `created_by` int(11) NOT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `deleted_by` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL
) ENGINE=InnoDB;");
}
if (!$CI->db->table_exists(db_prefix() . 'minutes_tasks')) {
$CI->db->query("
CREATE TABLE `". db_prefix() ."minutes_tasks` (
  `id` int(11) NOT NULL,
  `minute_id` int(11) NOT NULL,
  `task` text NOT NULL,
  `created_by` int(11) NOT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `deleted_by` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL
) ENGINE=InnoDB;");
}

if (!$CI->db->table_exists(db_prefix() . 'minutes')) {
$CI->db->query("
CREATE TABLE `". db_prefix() ."minutes` (
  `id` int(11) NOT NULL,
  `short` varchar(250) NOT NULL,
  `location` varchar(255) NOT NULL,
  `rel_type` varchar(100) NOT NULL,
  `rel_id` int(11) NOT NULL,
  `objectives` text NOT NULL,
  `achievements` text NOT NULL,
  `logistics` text NOT NULL,
  `offtopic` text NOT NULL,
  `followup` text NOT NULL,
  `notes` text NOT NULL,
  `start` date DEFAULT NULL,
  `status` int(11) NOT NULL,
  `created_by` int(11) NOT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `deleted_by` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL
) ENGINE=InnoDB;");
}
