Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <config>
  3. <modules>
  4. <Practice_CheckoutComments>
  5. <active>true</active>
  6. <codePool>local</codePool>
  7. <depends>
  8. <Mage_Sales />
  9. <Mage_CatalogInventory />
  10. <Mage_Checkout />
  11. </depends>
  12. </Practice_CheckoutComments>
  13. </modules>
  14. </config>
  15.  
  16. <?xml version="1.0" encoding="UTF-8"?>
  17. <config>
  18. <modules>
  19. <Practice_CheckoutComments>
  20. <version>0.0.1</version>
  21. </Practice_CheckoutComments>
  22. </modules>
  23.  
  24. <global>
  25. <resources>
  26. <checkoutcomments_setup>
  27. <setup>
  28. <module>Practice_CheckoutComments</module>
  29. </setup>
  30. </checkoutcomments_setup>
  31. </resources>
  32. </global>
  33. </config>
  34.  
  35. <?php
  36. $installer = $this;
  37. $installer->startSetup();
  38.  
  39. $table = $installer->getConnection()
  40. ->newTable($installer->getTable('checkoutcomments/comments_table'))
  41. ->addColumn('comment_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null,
  42. array(
  43. 'identity' => true,
  44. 'unsigned' => true,
  45. 'nullable' => false,
  46. 'primary' => true
  47. ), 'Comment ID')
  48. ->addColumn('order_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null,
  49. array(
  50. 'unsigned' => true,
  51. 'nullable' => false
  52. ), 'Real Order ID')
  53. ->addColumn('comment', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array(), 'Comment')
  54. ->addForeignKey(
  55. $installer->getFkName('checkoutcomments/comments_table', 'order_id',
  56. 'sales/order', 'entity_id'), 'order_id',
  57. $installer->getTable('sales/order'), 'entity_id',
  58. Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
  59. ->setComment('Checkout Comments');
  60.  
  61. $installer->getConnection()->createTable($table);
  62. $installer->endSetup();
  63. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement