You are here

commerce_price_table.install in Commerce Price Table 7

File

commerce_price_table.install
View source
<?php

/**
 * Implements hook_field_schema().
 */
function commerce_price_table_field_schema($field) {
  if ($field['type'] == 'commerce_price_table') {
    return array(
      'columns' => array(
        'amount' => array(
          'description' => 'The price amount.',
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
        ),
        'currency_code' => array(
          'description' => 'The currency code for the price.',
          'type' => 'varchar',
          'length' => 32,
          'not null' => TRUE,
        ),
        'min_qty' => array(
          'description' => 'The minimal quantity for this amount.',
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
        ),
        'max_qty' => array(
          'description' => 'The maximum quantity for this amount.',
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
        ),
        'data' => array(
          'description' => 'A serialized array of additional price data.',
          'type' => 'text',
          'size' => 'big',
          'not null' => FALSE,
          'serialize' => TRUE,
        ),
      ),
      'indexes' => array(
        'currency_price_table' => array(
          'amount',
          'currency_code',
        ),
      ),
    );
  }
}

Functions