本文整理匯總了PHP中Varien_Db_Adapter_Interface::createTable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Db_Adapter_Interface::createTable方法的具體用法?PHP Varien_Db_Adapter_Interface::createTable怎麽用?PHP Varien_Db_Adapter_Interface::createTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Varien_Db_Adapter_Interface
的用法示例。
在下文中一共展示了Varien_Db_Adapter_Interface::createTable方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
protected function setUp()
{
$installer = new Mage_Core_Model_Resource_Setup(Mage_Core_Model_Resource_Setup::DEFAULT_SETUP_CONNECTION);
$this->_connection = $installer->getConnection();
$this->_tableName = $installer->getTable('table_two_column_idx');
$this->_oneColumnIdxName = $installer->getIdxName($this->_tableName, array('column1'));
$this->_twoColumnIdxName = $installer->getIdxName($this->_tableName, array('column1', 'column2'));
$table = $this->_connection->newTable($this->_tableName)->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true), 'Id')->addColumn('column1', Varien_Db_Ddl_Table::TYPE_INTEGER)->addColumn('column2', Varien_Db_Ddl_Table::TYPE_INTEGER)->addIndex($this->_oneColumnIdxName, array('column1'))->addIndex($this->_twoColumnIdxName, array('column1', 'column2'));
$this->_connection->createTable($table);
}
示例2: _createChangelogTable
/**
* Create Changelog Table
*
* @return Enterprise_Mview_Model_Action_Changelog_Create
*/
protected function _createChangelogTable()
{
$this->_connection->createTable($this->_getChangelogTableConfig());
return $this;
}
示例3: _createTmpTable
/**
* 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->dropTable($this->_getMainTmpTable());
$this->_connection->createTable($table);
}