mandrill_simplenews_report.install 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. /**
  3. * @file
  4. * Creates the table with mail, count of emails sent and tid fields.
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function mandrill_simplenews_report_schema() {
  10. $schema['mandrill_simplenews_report_newsletter_report'] = array(
  11. 'fields' => array(
  12. 'id' => array(
  13. 'type' => 'serial',
  14. 'not null' => TRUE,
  15. ),
  16. 'report_id' => array(
  17. 'type' => 'varchar',
  18. 'length' => 32,
  19. 'not null'=> TRUE,
  20. ),
  21. 'tid' => array(
  22. 'type' => 'int',
  23. 'not null' => TRUE,
  24. ),
  25. 'created' => array(
  26. 'type' => 'int',
  27. 'not null' => TRUE,
  28. ),
  29. ),
  30. 'primary key' => array('id'),
  31. 'mysql_engine' => 'MyISAM',
  32. );
  33. $schema['mandrill_simplenews_report_newsletter_sent'] = array(
  34. 'fields' => array(
  35. 'id' => array(
  36. 'type' => 'serial',
  37. 'not null' => TRUE,
  38. ),
  39. 'sent_timestamp' => array(
  40. 'type' => 'int',
  41. 'not null' => TRUE,
  42. ),
  43. 'sent_to_mail' => array(
  44. 'type' => 'varchar',
  45. 'length' => 254,
  46. 'not null'=> TRUE,
  47. ),
  48. 'from_mail' => array(
  49. 'type' => 'varchar',
  50. 'length' => 254,
  51. 'not null' => TRUE,
  52. ),
  53. 'subject' => array(
  54. 'type' => 'varchar',
  55. 'length' => 255,
  56. 'not null' => TRUE,
  57. ),
  58. 'tid' => array(
  59. 'type' => 'int',
  60. 'not null' => TRUE,
  61. ),
  62. 'open_count' => array(
  63. 'type' => 'int',
  64. 'not null' => TRUE,
  65. ),
  66. 'click_count' => array(
  67. 'type' => 'int',
  68. 'not null' => TRUE,
  69. ),
  70. ),
  71. 'primary key' => array('id'),
  72. 'indexes' => array(
  73. 'sent_timestamp' => array('sent_timestamp'),
  74. 'sent_to_mail' => array('sent_to_mail'),
  75. 'from_mail' => array('from_mail'),
  76. ),
  77. 'mysql_engine' => 'MyISAM',
  78. );
  79. $schema['mandrill_simplenews_report_subscription_extra'] = array(
  80. 'fields' => array(
  81. 'snid' => array(
  82. 'type' => 'int',
  83. 'not null' => TRUE,
  84. ),
  85. 'tid' => array(
  86. 'type' => 'int',
  87. 'not null' => TRUE,
  88. ),
  89. 'last_interaction' => array(
  90. 'type' => 'int',
  91. 'not null' => TRUE,
  92. ),
  93. ),
  94. 'indexes' => array(
  95. 'snid' => array('snid'),
  96. 'tid' => array('tid'),
  97. ),
  98. );
  99. return $schema;
  100. }