123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?php
- /**
- * @file
- * Install, update and uninstall functions for the block_class module.
- */
- /**
- * Implementation of hook_schema().
- */
- function block_class_schema() {
- $schema['block_class'] = array(
- 'fields' => array(
- 'module' => array(
- 'type' => 'varchar',
- 'length' => 64,
- 'not null' => TRUE,
- 'default' => '',
- 'description' => 'The module to which the block belongs.',
- ),
- 'delta' => array(
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => TRUE,
- 'default' => '',
- 'description' => "The ID of the module's block.",
- ),
- 'css_class' => array(
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- 'default' => '',
- 'description' => 'String containing the classes for the block.',
- ),
- ),
- 'primary key' => array('module', 'delta'),
- );
- return $schema;
- }
- /**
- * Alters the structure of {block_class} schema.
- */
- function block_class_update_7100() {
- // Update the schema.
- db_drop_primary_key('block_class');
- db_change_field('block_class', 'module', 'module',
- array(
- 'type' => 'varchar',
- 'length' => '255',
- 'not null' => TRUE,
- 'default' => '',
- 'description' => 'The module to which the block belongs.',
- )
- );
- db_change_field('block_class', 'delta', 'delta',
- array(
- 'type' => 'varchar',
- 'length' => '255',
- 'not null' => TRUE,
- 'default' => '',
- 'description' => "The ID of the module's block.",
- )
- );
- db_change_field('block_class', 'css_class', 'css_class',
- array(
- 'type' => 'varchar',
- 'length' => '255',
- 'not null' => TRUE,
- 'default' => '',
- 'description' => 'String containing the classes for the block.',
- )
- );
- // Restore the primary key.
- db_add_primary_key('block_class', array('module', 'delta'));
- }
- /**
- * Fix too long primary key length in {block_class}.
- */
- function block_class_update_7101() {
- // Drop current primary key.
- db_drop_primary_key('block_class');
- db_change_field('block_class', 'module', 'module', array(
- 'type' => 'varchar',
- 'length' => 64,
- 'not null' => TRUE,
- 'default' => '',
- 'description' => 'The module to which the block belongs.',
- ));
- db_change_field('block_class', 'delta', 'delta', array(
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => TRUE,
- 'default' => '',
- 'description' => "The ID of the module's block.",
- ));
- // Create new primary key.
- db_add_primary_key('block_class', array('module', 'delta'));
- }
|