node_reference.install 746 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the node_reference module.
  5. */
  6. /**
  7. * Implements hook_field_schema().
  8. */
  9. function node_reference_field_schema($field) {
  10. $columns = array(
  11. 'nid' => array(
  12. 'type' => 'int',
  13. 'unsigned' => TRUE,
  14. 'not null' => FALSE,
  15. ),
  16. );
  17. return array(
  18. 'columns' => $columns,
  19. 'indexes' => array('nid' => array('nid')),
  20. 'foreign keys' => array(
  21. 'nid' => array(
  22. 'table' => 'node',
  23. 'columns' => array('nid' => 'nid'),
  24. ),
  25. ),
  26. );
  27. }
  28. /**
  29. * Rebuild views data cache (a callabck was renamed).
  30. */
  31. function node_reference_update_7000() {
  32. if (function_exists('views_invalidate_cache')) {
  33. views_invalidate_cache();
  34. }
  35. }