You are here

function block_country_install in Block Country 7

Implements hook_install().

File

./block_country.install, line 52
Schema definitions install/update/uninstall hooks.

Code

function block_country_install() {
  $schema['block'] = array();
  block_country_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);
    }
  }
}