cer.install 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * @file
  4. * Install file providing corresponding entity reference schema.
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function cer_schema() {
  10. $schema['cer'] = array(
  11. 'description' => t('Saves the content types and entity reference fields for which the corresponding entity reference is enabled'),
  12. 'fields' => array(
  13. 'entity_types_content_fields' => array('type' => 'varchar', 'length' => 200, 'not null' => TRUE, 'default' => ''),
  14. 'enabled' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
  15. ),
  16. 'primary key' => array('entity_types_content_fields'),
  17. 'export' => array(
  18. 'key' => 'entity_types_content_fields',
  19. 'status' => 'enabled',
  20. 'primary key' => 'entity_types_content_fields',
  21. 'key name' => 'Corresponding entity reference',
  22. 'identifier' => 'cnr_obj',
  23. 'api' => array(
  24. 'api' => 'default_cer_presets',
  25. 'owner' => 'cer',
  26. 'minimum_version' => 1,
  27. 'current_version' => 1,
  28. ),
  29. ),
  30. );
  31. return $schema;
  32. }
  33. /**
  34. * Rename table to shorten module name.
  35. */
  36. function cer_update_7001() {
  37. db_rename_table('corresponding_entity_references', 'cer');
  38. }