<?php
// $Id: user_relationship_implications.install,v 1.1.2.5 2009/01/14 11:03:03 alexk Exp $

/**
 * @file
 * User Relationship Implications Schema
 */
function user_relationship_implications_schema() {
  $schema['user_relationship_implications'] = array(
    'fields'  => array(
      'riid'          => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
      'rtid'          => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
      'implies_rtid'  => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
      'strict'        => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
      'reverse'       => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
    ),
    'indexes' => array(
      'rtid'          => array('rtid'),
      'implies_rtid'  => array('implies_rtid'),
    ),
    'primary key' => array('riid'),
  );

  return $schema;
}

/**
 * Install
 */
function user_relationship_implications_install() {
  drupal_install_schema('user_relationship_implications');
}

/**
 * Uninstall
 */
function user_relationship_implications_uninstall() {
  drupal_uninstall_schema('user_relationship_implications');
}

/**
 * Updates
 */
function user_relationship_implications_update_1() {
  $ret = array();

  db_add_field(
    $ret,
    'user_relationship_implications',
    'reverse',
    array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny')
  );

  return $ret;
}