<?php

/**
 * @file
 * Bean UUID installation and schema hooks.
 */

/**
 * Implements hook_schema_alter().
 */
function bean_uuid_schema_alter(&$schema = array()) {
  $field = uuid_schema_field_definition();
  $schema['bean']['fields']['uuid'] = $field;
}

/**
 * Implements hook_install().
 */
function bean_uuid_install() {
  $field = uuid_schema_field_definition();
  db_add_field('bean', 'uuid', $field);
  db_add_index('bean', 'uuid', array('uuid'));
}

/**
 * Implements hook_enable().
 */
function bean_uuid_enable() {
  uuid_sync_all();
}

/**
 * Implements hook_uninstall().
 */
function bean_uuid_uninstall() {
  db_drop_field('bean', 'uuid');
  db_drop_index('bean', 'uuid');
}
