<?php
/**
 * @file
 * VS Conditions - module installation and uninstallation.
 */

/**
 * Implements hook_schema().
 */
function virtual_site_condition_schema() {
  $schema = array();

  $schema['virtual_site_conditions'] = array(
    'description' => 'Stores virtual site conditions.',
    'fields' => array(
      'cid' => array(
        'description' => 'Primary Key: Unique condition ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'Name of the condition.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'weight' => array(
        'description' => 'Ordering weight of condition.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'description' => 'Status of the condition: 0 = disabled, 1 = enabled.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 1,
      ),
      'parameters' => array(
        'description' => 'Serialized array containing parameters linked to the condition.',
        'type' => 'blob',
        'size' => 'big',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array('cid'),
  );

  return $schema;
}
