/**
  * Create tmp table
  */
 protected function _createTmpTable()
 {
     $table = $this->_connection->newTable($this->_getMainTmpTable())->addColumn('category_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => false, 'primary' => true, 'default' => '0'), 'Category ID')->addColumn('product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => false, 'primary' => true, 'default' => '0'), 'Product ID')->addColumn('position', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => false, 'nullable' => true, 'default' => null), 'Position')->addColumn('is_parent', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array('unsigned' => true, 'nullable' => false, 'default' => '0'), 'Is Parent')->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array('unsigned' => true, 'nullable' => false, 'primary' => true, 'default' => '0'), 'Store ID')->addColumn('visibility', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array('unsigned' => true, 'nullable' => false), 'Visibility')->setComment('Catalog Category Product Index Tmp');
     $this->_connection->dropTemporaryTable($this->_getMainTmpTable());
     $this->_connection->createTemporaryTable($table);
 }
 /**
  * Create temporary table
  */
 protected function _createTemporaryTable()
 {
     $this->_connection->dropTemporaryTable($this->_getTemporaryTable());
     $table = $this->_connection->newTable($this->_getTemporaryTable())->addColumn('grouped_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, 80, array(), 'Grouped ID')->addColumn('product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true), 'Product ID')->addColumn('customer_group_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5, array('unsigned' => true), 'Customer Group ID')->addColumn('from_date', Varien_Db_Ddl_Table::TYPE_DATE, null, array(), 'From Date')->addColumn('to_date', Varien_Db_Ddl_Table::TYPE_DATE, null, array(), 'To Date')->addColumn('action_amount', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array(), 'Action Amount')->addColumn('action_operator', Varien_Db_Ddl_Table::TYPE_VARCHAR, 10, array(), 'Action Operator')->addColumn('action_stop', Varien_Db_Ddl_Table::TYPE_SMALLINT, 6, array(), 'Action Stop')->addColumn('sort_order', Varien_Db_Ddl_Table::TYPE_INTEGER, 10, array('unsigned' => true), 'Sort Order')->addColumn('price', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array(), 'Product Price')->addColumn('rule_product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true), 'Rule Product ID')->addColumn('from_time', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => true, 'default' => 0), 'From Time')->addColumn('to_time', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => true, 'default' => 0), 'To Time')->addIndex($this->_connection->getIndexName($this->_getTemporaryTable(), 'grouped_id'), array('grouped_id'))->setComment('CatalogRule Price Temporary Table');
     $this->_connection->createTemporaryTable($table);
 }
 /**
  * Create redirects temporary table
  *
  * @return void
  */
 protected function _createRedirectTemporaryTable()
 {
     $temporaryTable = $this->_connection->newTable(self::TMP_TABLE_NAME);
     $temporaryTable->addColumn('identifier', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255)->addColumn('target_path', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255)->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_INTEGER)->addColumn('category_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true))->addColumn('product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true))->addIndex('UNQ_ENTERPRISE_URL_REWRITE_TMP_IDENTIFIER_STORE_ID', array('identifier', 'store_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE));
     $this->_connection->createTemporaryTable($temporaryTable);
 }