Last active
August 29, 2015 14:06
-
-
Save davefreiman/a2bc19c85726a480881b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$installer = $this; | |
$installer->startSetup(); | |
$installer->run("DROP TABLE IF EXISTS {$installer->getTable('demac_casl/subscriber')};"); | |
$table = $installer->getConnection() | |
->newTable($installer->getTable('demac_casl/subscriber')) | |
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( | |
'identity' => true, | |
'unsigned' => true, | |
'nullable' => false, | |
'primary' => true, | |
), 'ID') | |
->addColumn('subscriber_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( | |
'nullable' => false, | |
), 'Subscriber Id') | |
->addColumn('ip_address', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array( | |
'nullable' => false, | |
), 'IP Address') | |
->addColumn('date_subscribed', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array( | |
'nullable' => false, | |
), 'Date Subscribed') | |
->addColumn('referrer_url', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array( | |
'nullable' => false, | |
), 'Referrer Url') | |
->addForeignKey('FK_SUBSCRIBER_ID', | |
'subscriber_id', | |
$installer->getTable('newsletter/subscriber'), | |
'subscriber_id', | |
'CASCADE', | |
'CASCADE'); | |
$installer->getConnection()->createTable($table); | |
$installer->endSetup(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment