You are here

user_relationship_blocks.install in User Relationships 7

Same filename and directory in other branches
  1. 6 user_relationship_blocks/user_relationship_blocks.install

User relationship blocks installation

File

user_relationship_blocks/user_relationship_blocks.install
View source
<?php

/**
 * @file
 * User relationship blocks installation
 */

/**
 * Schema
 */
function user_relationship_blocks_schema() {
  $schema['user_relationship_blocks'] = array(
    'fields' => array(
      'bid' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'size' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'default' => 10,
      ),
      'sort' => array(
        'type' => 'varchar',
        'length' => 255,
        'default' => 'newest',
      ),
    ),
    'primary key' => array(
      'bid',
    ),
  );
  return $schema;
}

/**
 * Implements hook_update_N().
 * Update 6000 creates db tables after upgrade from D5.
 */
function user_relationship_blocks_update_6000() {

  //do not execute if table already exists, to catch normal D6 updates.
  if (db_table_exists('user_relationship_blocks')) {
    return array();
  }
  user_relationship_blocks_install();
  return array();
}

/**
 * Implements hook_update_N().
 * Update 6100 updates block caching flags #458520.
 */
function user_relationship_blocks_update_6100() {
  $ret = array();
  $ret[] = update_sql("UPDATE {blocks} SET cache = -1 WHERE module = 'user_relationship_blocks' AND delta IN ('actions', 'pending', 'user-all', 'my-all')");
  return $ret;
}

/**
 * Drop unnecessary get_account column.
 */
function user_relationship_blocks_update_7000() {
  db_drop_field('user_relationship_blocks', 'get_account');
}

Functions

Namesort descending Description
user_relationship_blocks_schema Schema
user_relationship_blocks_update_6000 Implements hook_update_N(). Update 6000 creates db tables after upgrade from D5.
user_relationship_blocks_update_6100 Implements hook_update_N(). Update 6100 updates block caching flags #458520.
user_relationship_blocks_update_7000 Drop unnecessary get_account column.