You are here

function commerce_price_table_field_schema in Commerce Price Table 7

Implements hook_field_schema().

File

./commerce_price_table.install, line 6

Code

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',
        ),
      ),
    );
  }
}