You are here

function block_token_install in Block Token 7

Implements hook_install().

File

./block_token.install, line 11
Install, update and uninstall functions for the block_token module.

Code

function block_token_install() {
  $schema['block'] = array();
  block_token_schema_alter($schema);
  foreach ($schema['block']['fields'] as $field => $spec) {
    if (db_field_exists('block', $field)) {
      watchdog('system', 'Module install: Attempt to recreate field: "%field", when it already exists.', array(
        '%field' => $field,
      ), WATCHDOG_WARNING);
    }
    else {
      db_add_field('block', $field, $spec);
    }
  }
}