'Stores the contents of icon bundles.', 'fields' => array( 'name' => array( 'description' => 'The name of the icon bundle.', 'type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '', ), 'bundle' => array( 'description' => 'The array data belonging to the icon bundle.', 'type' => 'blob', 'serialize' => TRUE, 'size' => 'big', ), 'status' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 1, 'size' => 'tiny', 'description' => 'The enabled status. (1 = enabled, 0 = disabled) of the icon bundle.', ), ), 'primary key' => array('name'), ); return $schema; } /** * Set module weight. */ function icon_set_module_weight($module, $weight = 100) { db_query("UPDATE {system} SET weight = :weight WHERE name = :module AND type = 'module'", array( ':module' => $module, ':weight' => $weight, )); } /** * Add fields to schema if they don't exist. */ function icon_install_create_fields($table, $fields) { static $schema; // Do not force schema refresh more than once per request. $schema = drupal_get_schema($table, !isset($schema)); foreach ($fields as $field) { if (!empty($schema['fields'][$field])) { if (!db_field_exists($table, $field)) { db_add_field($table, $field, $schema['fields'][$field]); } else { // The field exists, make sure field definition is up to date. db_change_field($table, $field, $field, $schema['fields'][$field]); } } } }