Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magento1810_local`.`frostnet_rule_website`, CONSTRAINT `FK_FROSTNET_RULE_WS_RULE_ID_FROSTNET_RULE_RULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `frostnet_rule/rule` (`rule_)' in /Users/simonfrost/PhpStormProjects/magento1810.local/www/lib/Zend/Db/Statement/Pdo.php:228
- Stack trace:
- #0 /Users/simonfrost/PhpStormProjects/magento1810.local/www/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
- #1 /Users/simonfrost/PhpStormProjects/magento1810.local/www/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
- #2 /Users/simonfrost/PhpStormProjects/magento1810.local/www/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
- #3 /Users/simonfrost/PhpStormProjects/magento1810.local/www/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
- #4 /Users/simonfrost/PhpStormProjects/magento1810.local/www/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `fr...', Array)
- #5 /Users/simonfrost/PhpStormProjects/magento1810.local/www/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `fr...', Array)
- #6 /Users/simonfrost/PhpStormProjects/magento1810.local/www/lib/Varien/Db/Adapter/Pdo/Mysql.php(1934): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `fr...', Array)
- #7 /Users/simonfrost/PhpStormProjects/magento1810.local/www/app/code/core/Mage/Rule/Model/Resource/Abstract.php(171): Varien_Db_Adapter_Pdo_Mysql->insertOnDuplicate('frostnet_messageru...', Array, Array)
- #8 /Users/simonfrost/PhpStormProjects/magento1810.local/www/app/code/local/Frostnet/Rule/Model/Resource/Rule.php(61): Mage_Rule_Model_Resource_Abstract->bindRuleToEntity('1', Array, 'website')
- $table = $installer->getConnection()->newTable($installer->getTable('frostnet_rule/website'))
- ->addColumn('rule_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
- 'unsigned' => true,
- 'nullable' => false,
- 'primary' => true
- ),
- 'Rule Id'
- )
- ->addColumn('website_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
- 'unsigned' => true,
- 'nullable' => false,
- 'primary' => true
- ),
- 'Website Id'
- )
- ->addIndex(
- $installer->getIdxName('frostnet_rule/website', array('rule_id')),
- array('rule_id')
- )
- ->addIndex(
- $installer->getIdxName('frostnet_rule/website', array('website_id')),
- array('website_id')
- )
- ->addForeignKey(
- $installer->getFkName('frostnet_rule/website', 'rule_id', 'frostnet_rule/rule', 'rule_id'),
- 'rule_id', 'frostnet_rule/rule', 'rule_id',
- Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
- )
- ->addForeignKey(
- $installer->getFkName('frostnet_rule/website', 'website_id', 'core/website', 'website_id'),
- 'website_id', 'core/website', 'website_id',
- Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
- )
- ->setComment('Zone8 MessageRule Rules To Websites Relations');
- $installer->getConnection()->createTable($table);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement