filter.install

  1. 7.x drupal-7.x/modules/filter/filter.install
  2. 6.x drupal-6.x/modules/filter/filter.install

File

drupal-6.x/modules/filter/filter.install
View source
  1. <?php
  2. /**
  3. * Implementation of hook_schema().
  4. */
  5. function filter_schema() {
  6. $schema['filters'] = array(
  7. 'description' => 'Table that maps filters (HTML corrector) to input formats (Filtered HTML).',
  8. 'fields' => array(
  9. 'fid' => array(
  10. 'type' => 'serial',
  11. 'not null' => TRUE,
  12. 'description' => 'Primary Key: Auto-incrementing filter ID.',
  13. ),
  14. 'format' => array(
  15. 'type' => 'int',
  16. 'not null' => TRUE,
  17. 'default' => 0,
  18. 'description' => 'Foreign key: The {filter_formats}.format to which this filter is assigned.',
  19. ),
  20. 'module' => array(
  21. 'type' => 'varchar',
  22. 'length' => 64,
  23. 'not null' => TRUE,
  24. 'default' => '',
  25. 'description' => 'The origin module of the filter.',
  26. ),
  27. 'delta' => array(
  28. 'type' => 'int',
  29. 'not null' => TRUE,
  30. 'default' => 0,
  31. 'size' => 'tiny',
  32. 'description' => 'ID to identify which filter within module is being referenced.',
  33. ),
  34. 'weight' => array(
  35. 'type' => 'int',
  36. 'not null' => TRUE,
  37. 'default' => 0,
  38. 'size' => 'tiny',
  39. 'description' => 'Weight of filter within format.',
  40. )
  41. ),
  42. 'primary key' => array('fid'),
  43. 'unique keys' => array(
  44. 'fmd' => array('format', 'module', 'delta'),
  45. ),
  46. 'indexes' => array(
  47. 'list' => array('format', 'weight', 'module', 'delta'),
  48. ),
  49. );
  50. $schema['filter_formats'] = array(
  51. 'description' => 'Stores input formats: custom groupings of filters, such as Filtered HTML.',
  52. 'fields' => array(
  53. 'format' => array(
  54. 'type' => 'serial',
  55. 'not null' => TRUE,
  56. 'description' => 'Primary Key: Unique ID for format.',
  57. ),
  58. 'name' => array(
  59. 'type' => 'varchar',
  60. 'length' => 255,
  61. 'not null' => TRUE,
  62. 'default' => '',
  63. 'description' => 'Name of the input format (Filtered HTML).',
  64. ),
  65. 'roles' => array(
  66. 'type' => 'varchar',
  67. 'length' => 255,
  68. 'not null' => TRUE,
  69. 'default' => '',
  70. 'description' => 'A comma-separated string of roles; references {role}.rid.', // This is bad since you can't use joins, nor index.
  71. ),
  72. 'cache' => array(
  73. 'type' => 'int',
  74. 'not null' => TRUE,
  75. 'default' => 0,
  76. 'size' => 'tiny',
  77. 'description' => 'Flag to indicate whether format is cachable. (1 = cachable, 0 = not cachable)',
  78. ),
  79. ),
  80. 'primary key' => array('format'),
  81. 'unique keys' => array('name' => array('name')),
  82. );
  83. $schema['cache_filter'] = drupal_get_schema_unprocessed('system', 'cache');
  84. $schema['cache_filter']['description'] = 'Cache table for the Filter module to store already filtered pieces of text, identified by input format and md5 hash of the text.';
  85. return $schema;
  86. }