You are here

function collapsiblock_install in Collapsiblock 7.2

Implements hook_install().

File

./collapsiblock.install, line 11
Install hooks for Collapsiblock.

Code

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