Skip to content

Instantly share code, notes, and snippets.

@amacgregor
Created August 12, 2013 22:40
Show Gist options
  • Save amacgregor/6216016 to your computer and use it in GitHub Desktop.
Save amacgregor/6216016 to your computer and use it in GitHub Desktop.
Creates the Registry Type tabke
/**
* Create Registry Type Table
*/
$tableName = $installer->getTable('mdg_giftregistry/type');
// Check if the table already exists
if ($installer->getConnection()->isTableExists($tableName) != true) {
$table = $installer->getConnection()
->newTable($installer->getTable('mdg_giftregistry/type'))
->addColumn('type_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
'identity' => true,
'unsigned' => true,
'nullable' => false,
'primary' => true,
), 'Type Id')
->addColumn('code', Varien_Db_Ddl_Table::TYPE_TEXT, 25, array(
'nullable' => true,
), 'Code')
->addColumn('name', Varien_Db_Ddl_Table::TYPE_TEXT, 250, array(
'nullable' => true,
), 'name')
->addColumn('description', Varien_Db_Ddl_Table::TYPE_TEXT, 250, array(
'nullable' => true,
), 'Description')
->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null,
array(
'unsigned' => true,
'nullable' => false,
'default' => '0',
),
'Store Id')
->addColumn('is_active', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
'unsigned' => true,
'nullable' => false,
'default' => '1',
), 'Is Active')
->setComment('Magento Developers Guide Type Table');
$installer->getConnection()->createTable($table);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment