/** * Creates the migrations table if it does not exist. * @return null */ public function create_migrations_table() { // Make sure migrations have been installed. if (!$this->db_tools->sql_table_exists($this->table_prefix . 'migrations')) { $this->db_tools->sql_create_table($this->table_prefix . 'migrations', array('COLUMNS' => array('migration_name' => array('VCHAR', ''), 'migration_depends_on' => array('TEXT', ''), 'migration_schema_done' => array('BOOL', 0), 'migration_data_done' => array('BOOL', 0), 'migration_data_state' => array('TEXT', ''), 'migration_start_time' => array('TIMESTAMP', 0), 'migration_end_time' => array('TIMESTAMP', 0)), 'PRIMARY_KEY' => 'migration_name')); } }
/** * Create sphinx table * * @return string|bool error string is returned incase of errors otherwise false */ public function create_index($acp_module, $u_action) { if (!$this->index_created()) { $table_data = array('COLUMNS' => array('counter_id' => array('UINT', 0), 'max_doc_id' => array('UINT', 0)), 'PRIMARY_KEY' => 'counter_id'); $this->db_tools->sql_create_table(SPHINX_TABLE, $table_data); $sql = 'TRUNCATE TABLE ' . SPHINX_TABLE; $this->db->sql_query($sql); $data = array('counter_id' => '1', 'max_doc_id' => '0'); $sql = 'INSERT INTO ' . SPHINX_TABLE . ' ' . $this->db->sql_build_array('INSERT', $data); $this->db->sql_query($sql); } return false; }