Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. 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
  2. Stack trace:
  3. #0 /Users/simonfrost/PhpStormProjects/magento1810.local/www/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
  4. #1 /Users/simonfrost/PhpStormProjects/magento1810.local/www/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
  5. #2 /Users/simonfrost/PhpStormProjects/magento1810.local/www/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
  6. #3 /Users/simonfrost/PhpStormProjects/magento1810.local/www/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
  7. #4 /Users/simonfrost/PhpStormProjects/magento1810.local/www/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `fr...', Array)
  8. #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)
  9. #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)
  10. #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)
  11. #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')
  12.  
  13. $table = $installer->getConnection()->newTable($installer->getTable('frostnet_rule/website'))
  14. ->addColumn('rule_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
  15. 'unsigned' => true,
  16. 'nullable' => false,
  17. 'primary' => true
  18. ),
  19. 'Rule Id'
  20. )
  21. ->addColumn('website_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
  22. 'unsigned' => true,
  23. 'nullable' => false,
  24. 'primary' => true
  25. ),
  26. 'Website Id'
  27. )
  28. ->addIndex(
  29. $installer->getIdxName('frostnet_rule/website', array('rule_id')),
  30. array('rule_id')
  31. )
  32. ->addIndex(
  33. $installer->getIdxName('frostnet_rule/website', array('website_id')),
  34. array('website_id')
  35. )
  36. ->addForeignKey(
  37. $installer->getFkName('frostnet_rule/website', 'rule_id', 'frostnet_rule/rule', 'rule_id'),
  38. 'rule_id', 'frostnet_rule/rule', 'rule_id',
  39. Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
  40. )
  41. ->addForeignKey(
  42. $installer->getFkName('frostnet_rule/website', 'website_id', 'core/website', 'website_id'),
  43. 'website_id', 'core/website', 'website_id',
  44. Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE
  45. )
  46. ->setComment('Zone8 MessageRule Rules To Websites Relations');
  47.  
  48. $installer->getConnection()->createTable($table);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement