You are here

function sms_valid_schema in SMS Framework 7

Same name and namespace in other branches
  1. 6.2 modules/sms_valid/sms_valid.install \sms_valid_schema()
  2. 6 modules/sms_valid/sms_valid.install \sms_valid_schema()

Implements hook_schema().

Return value

array Drupal schema array.

File

modules/sms_valid/sms_valid.install, line 24
SMS Framework Number Validation feature module: Install file.

Code

function sms_valid_schema() {
  $schema = array();
  $schema['sms_valid_rules'] = array(
    'fields' => array(
      'prefix' => array(
        'type' => 'int',
        'size' => 'small',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Number prefix/code; 1-65535',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'description' => 'Descriptive name for this prefix/ruleset',
      ),
      'rules' => array(
        'type' => 'text',
        'not null' => FALSE,
        'serialize' => TRUE,
        'description' => 'Serialized ruleset',
      ),
      'dirs_enabled' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 4,
        'description' => 'Active msg directions. See SMS_DIR_* constants.',
      ),
      'iso2' => array(
        'type' => 'varchar',
        'length' => 2,
        'not null' => FALSE,
        'description' => 'ISO 3166-1 alpha-2 country code',
      ),
    ),
    'primary key' => array(
      'prefix',
    ),
  );
  return $schema;
}