dependent_country_state-1.0.6/dependent_country_state.install

dependent_country_state.install
<?php

/**
 * @file
 * Helps to create database for storing voucher data.
 */

/**
 * hook_schema()
 */
function dependent_country_state_schema() {

  $schema['dependent_country'] = array(
    'description' => 'Store Country table definition',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'size' => 'medium',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique ID.',
      ),
      'country_name' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'description' => 'Country Name',
      ),
      'country_code' => array(
        'type' => 'varchar',
        'length' => 55,
        'not null' => FALSE,
        'description' => 'Country Code',
      ),
    'logo' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'description' => 'Country Logo',
      ),
    'status' => array(
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 1,
        'description' => 'Status of country',
      ),

      'created' => array(
        'description' => 'Timestamp of date',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),

    ),

     'primary key' => ['id'],

  );

   $schema['dependent_state'] = array(
    'description' => 'Store state table definition',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'size' => 'big',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique ID.',
      ),

      'countryId' => array(
        'type' => 'int',
        'size' => 'medium',
        'not null' => TRUE,
        'description' => 'Country ID',
      ),

      'state_name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'description' => 'State Name',
      ),

      'status' => array(
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 1,
        'description' => 'Status of country',
      ),

       'created' => array(
        'description' => 'Timestamp of date',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),

    'primary key' => ['id'],

  );


   $schema['dependent_city'] = array(

    'description' => 'City table definition',
    'fields' => array(

      'id' => array(
        'type' => 'serial',
        'size' => 'big',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique ID.',
      ),

      'countryId' => array(
        'type' => 'int',
        'size' => 'big',
        'not null' => TRUE,
        'description' => 'State ID',
      ),

      'stateId' => array(
        'type' => 'int',
        'size' => 'big',
        'not null' => TRUE,
        'description' => 'State ID',
      ),

      'city_name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'description' => 'State Name',
      ),

      'status' => array(
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 1,
        'description' => 'Status of country',
      ),

       'created' => array(
        'description' => 'Timestamp of date',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),

    'primary key' => ['id'],

  );

   $schema['dependent_pincode'] = array(

    'description' => 'Pincode table definition',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'size' => 'big',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique ID.',
      ),
       'countryId' => array(
        'type' => 'int',
        'size' => 'big',
        'not null' => TRUE,
        'description' => 'State ID',
      ),

      'stateId' => array(
        'type' => 'int',
        'size' => 'big',
        'not null' => TRUE,
        'description' => 'State ID',
      ),
      'cityId' => array(
        'type' => 'int',
        'size' => 'big',
        'not null' => FALSE,
        'description' => 'State ID',
      ),

      'area_name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
        'description' => 'Area Name',
      ),

      'pincode' => array(
        'type' => 'char',
        'length' => '10',
        'not null' => FALSE,
        'description' => 'Pincode',
      ),

      'created' => array(
        'description' => 'Timestamp of date',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),

    'primary key' => ['id'],

  );

  return $schema;
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc