You are here

function uuid_install in Universally Unique IDentifier 5

Same name and namespace in other branches
  1. 6 uuid.install \uuid_install()
  2. 7 uuid.install \uuid_install()

Implementation of hook_install().

File

./uuid.install, line 6

Code

function uuid_install() {
  $tables = array(
    'node' => 'nid',
    'users' => 'uid',
    'node_revisions' => 'vid',
  );
  foreach ($tables as $table => $key) {

    // Create tables.
    db_query(uuid_table_schema($table, $key));

    // Build UUIDs.
    db_query('INSERT INTO {uuid_' . $table . '} SELECT ' . $key . ', UUID() FROM {' . $table . '}');
  }
}