You are here

sms_international.install in SMS Framework 7

Same filename and directory in other branches
  1. 6.2 modules/sms_international/sms_international.install

File

modules/sms_international/sms_international.install
View source
<?php

/**
 * Implements hook_install().
 */
function sms_international_install() {
  db_query("INSERT INTO {sms_international} (iso, name, country_code, min_length, max_length, status) VALUES ('es', 'Spain', '34', '9', '9', 1)");
  db_query("INSERT INTO {sms_international} (iso, name, country_code, min_length, max_length, status) VALUES ('gb', 'United Kingdom', '44', '9', '10', 1)");
  db_query("INSERT INTO {sms_international} (iso, name, country_code, min_length, max_length, status) VALUES ('us', 'United States', '1', '10', '10', 1)");
}

/**
 * Implements hook_schema().
 */
function sms_international_schema() {
  $schema['sms_international'] = array(
    'fields' => array(
      'iso' => array(
        'type' => 'varchar',
        'length' => 2,
        'not null' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'country_code' => array(
        'type' => 'varchar',
        'length' => 4,
        'not null' => TRUE,
      ),
      'min_length' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'max_length' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'iso',
    ),
    'indexes' => array(
      'country_code' => array(
        'country_code',
      ),
    ),
  );
  return $schema;
}

Functions