manifest.install 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. /**
  3. * @file
  4. * Manifest module install file.
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function manifest_schema() {
  10. $schema['manifest_user'] = array(
  11. 'description' => 'Store the users that are in manifest.',
  12. 'fields' => array(
  13. 'uid' => array(
  14. 'type' => 'int',
  15. 'not null' => TRUE,
  16. 'default' => 0,
  17. 'description' => 'The User ID',
  18. ),
  19. 'manifest' => array(
  20. 'description' => 'The manifest this entry belongs to.',
  21. 'type' => 'varchar',
  22. 'length' => 32,
  23. 'not null' => TRUE,
  24. 'default' => '',
  25. ),
  26. 'created' => array(
  27. 'description' => 'A Unix timestamp indicating when this record was created.',
  28. 'type' => 'int',
  29. 'not null' => TRUE,
  30. ),
  31. ),
  32. 'primary key' => array('uid', 'manifest'),
  33. );
  34. $schema['manifest_role'] = array(
  35. 'description' => 'Store the roles that are in manifest.',
  36. 'fields' => array(
  37. 'rid' => array(
  38. 'type' => 'int',
  39. 'not null' => TRUE,
  40. 'default' => 0,
  41. 'description' => 'The Role ID',
  42. ),
  43. 'manifest' => array(
  44. 'description' => 'The manifest this entry belongs to.',
  45. 'type' => 'varchar',
  46. 'length' => 32,
  47. 'not null' => TRUE,
  48. 'default' => '',
  49. ),
  50. 'created' => array(
  51. 'description' => 'A Unix timestamp indicating when this record was created.',
  52. 'type' => 'int',
  53. 'not null' => TRUE,
  54. ),
  55. ),
  56. 'primary key' => array('rid', 'manifest'),
  57. );
  58. $schema['manifest_ip'] = array(
  59. 'description' => 'Store the IP addresses that are in manifest.',
  60. 'fields' => array(
  61. 'ip1' => array(
  62. 'type' => 'int',
  63. 'size' => 'big',
  64. 'not null' => TRUE,
  65. 'description' => 'The User IP address, or range start.',
  66. ),
  67. 'ip2' => array(
  68. 'type' => 'int',
  69. 'size' => 'big',
  70. 'not null' => TRUE,
  71. 'description' => 'The IP range end.',
  72. ),
  73. 'manifest' => array(
  74. 'description' => 'The manifest this entry belongs to.',
  75. 'type' => 'varchar',
  76. 'length' => 32,
  77. 'not null' => TRUE,
  78. 'default' => '',
  79. ),
  80. 'created' => array(
  81. 'description' => 'A Unix timestamp indicating when this record was created.',
  82. 'type' => 'int',
  83. 'not null' => TRUE,
  84. ),
  85. ),
  86. 'primary key' => array('ip1', 'ip2', 'manifest'),
  87. );
  88. $schema['manifest'] = array(
  89. 'description' => 'Store the basic settings for a manifest.',
  90. 'fields' => array(
  91. 'name' => array(
  92. 'description' => 'The machine-readable name of this manifest.',
  93. 'type' => 'varchar',
  94. 'length' => 32,
  95. 'not null' => TRUE,
  96. ),
  97. 'settings' => array(
  98. 'description' => 'Settings for this manifest.',
  99. 'type' => 'text',
  100. 'size' => 'big',
  101. 'not null' => TRUE,
  102. 'serialize' => TRUE,
  103. ),
  104. ),
  105. 'primary key' => array('name'),
  106. );
  107. $schema['manifest_config'] = array(
  108. 'description' => 'Store the config for a manifest. Only stores integer values.',
  109. 'fields' => array(
  110. 'manifest' => array(
  111. 'description' => 'The machine-readable name of the manifest.',
  112. 'type' => 'varchar',
  113. 'length' => 32,
  114. 'not null' => TRUE,
  115. ),
  116. 'field' => array(
  117. 'description' => 'The machine-readable name of the field.',
  118. 'type' => 'varchar',
  119. 'length' => 32,
  120. 'not null' => TRUE,
  121. ),
  122. 'delta' => array(
  123. 'description' => 'Delta for this entry.',
  124. 'type' => 'int',
  125. 'not null' => TRUE,
  126. 'default' => 0,
  127. ),
  128. 'value' => array(
  129. 'description' => 'Value for this entry.',
  130. 'type' => 'int',
  131. 'not null' => TRUE,
  132. 'default' => 0,
  133. ),
  134. ),
  135. 'primary key' => array('manifest', 'field', 'delta'),
  136. );
  137. return $schema;
  138. }