field_permission_example.install 840 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * @file
  4. * Install function for the field_permission_example module.
  5. */
  6. /**
  7. * Implements hook_field_schema().
  8. *
  9. * Defines the database schema of the field, using the format used by the
  10. * Schema API.
  11. *
  12. * We only want a simple text field, similar to the body of a node.
  13. *
  14. * Note that this field has only a normal text (which translates to
  15. * 16k of text in MySQL), and so therefore doesn't have an index.
  16. * More complex schema would probably have at least one indexed
  17. * column.
  18. *
  19. * @see http://drupal.org/node/146939
  20. * @see schemaapi
  21. * @see hook_field_schema()
  22. * @ingroup field_permission_example
  23. */
  24. function field_permission_example_field_schema($field) {
  25. $columns = array(
  26. 'notes' => array('type' => 'text', 'size' => 'normal', 'not null' => FALSE),
  27. );
  28. return array(
  29. 'columns' => $columns,
  30. );
  31. }