search_api_autocomplete.install 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the Search API autocomplete module.
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function search_api_autocomplete_schema() {
  10. $schema['search_api_autocomplete_search'] = array(
  11. 'description' => 'Stores autocomplete settings for searches on Search API indexes.',
  12. 'fields' => array(
  13. 'id' => array(
  14. 'description' => 'The primary identifier for a search.',
  15. 'type' => 'serial',
  16. 'unsigned' => TRUE,
  17. 'not null' => TRUE,
  18. ),
  19. 'machine_name' => array(
  20. 'description' => 'A string identifier for a search.',
  21. 'type' => 'varchar',
  22. 'length' => 100,
  23. 'not null' => TRUE,
  24. ),
  25. 'name' => array(
  26. 'description' => 'A human-readable name for the search.',
  27. 'type' => 'varchar',
  28. 'length' => 50,
  29. ),
  30. 'index_id' => array(
  31. 'description' => 'The {search_api_index}.machine_name this search belongs to.',
  32. 'type' => 'varchar',
  33. 'length' => 50,
  34. 'not null' => TRUE,
  35. ),
  36. 'type' => array(
  37. 'description' => 'The type of search, usually a module name.',
  38. 'type' => 'varchar',
  39. 'length' => 50,
  40. 'not null' => TRUE,
  41. ),
  42. 'enabled' => array(
  43. 'description' => 'A flag indicating whether autocompletion for this search is enabled.',
  44. 'type' => 'int',
  45. 'size' => 'tiny',
  46. 'not null' => TRUE,
  47. 'default' => 1,
  48. ),
  49. 'options' => array(
  50. 'description' => 'The options used to configure autocompletion for this search.',
  51. 'type' => 'text',
  52. 'serialize' => TRUE,
  53. 'not null' => TRUE,
  54. ),
  55. 'status' => array(
  56. 'description' => 'The exportable status of the entity.',
  57. 'type' => 'int',
  58. 'not null' => TRUE,
  59. 'default' => 0x01,
  60. 'size' => 'tiny',
  61. ),
  62. 'module' => array(
  63. 'description' => 'The name of the providing module if the entity has been defined in code.',
  64. 'type' => 'varchar',
  65. 'length' => 255,
  66. 'not null' => FALSE,
  67. ),
  68. ),
  69. 'primary key' => array('id'),
  70. 'unique keys' => array(
  71. 'machine_name' => array('machine_name'),
  72. ),
  73. 'indexes' => array(
  74. 'enabled' => array('enabled'),
  75. ),
  76. );
  77. return $schema;
  78. }