variable.install 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * @file
  4. * Variable API module install file
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function variable_schema() {
  10. $schema['cache_variable'] = array(
  11. 'description' => 'Cache table for variables.',
  12. 'fields' => array(
  13. 'cid' => array(
  14. 'description' => 'Primary Key: Unique cache ID.',
  15. 'type' => 'varchar',
  16. 'length' => 255,
  17. 'not null' => TRUE,
  18. 'default' => '',
  19. ),
  20. 'data' => array(
  21. 'description' => 'A collection of data to cache.',
  22. 'type' => 'blob',
  23. 'not null' => FALSE,
  24. 'size' => 'big',
  25. ),
  26. 'expire' => array(
  27. 'description' => 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
  28. 'type' => 'int',
  29. 'not null' => TRUE,
  30. 'default' => 0,
  31. ),
  32. 'created' => array(
  33. 'description' => 'A Unix timestamp indicating when the cache entry was created.',
  34. 'type' => 'int',
  35. 'not null' => TRUE,
  36. 'default' => 0,
  37. ),
  38. 'serialized' => array(
  39. 'description' => 'A flag to indicate whether content is serialized (1) or not (0).',
  40. 'type' => 'int',
  41. 'size' => 'small',
  42. 'not null' => TRUE,
  43. 'default' => 0,
  44. ),
  45. ),
  46. 'indexes' => array('expire' => array('expire')),
  47. 'primary key' => array('cid'),
  48. );
  49. return $schema;
  50. }
  51. /**
  52. * Implements hook_uninstall().
  53. */
  54. function variable_uninstall() {
  55. variable_del('variable_module_list');
  56. }