You are here

function uc_cart_links_schema in Ubercart 8.4

Same name and namespace in other branches
  1. 6.2 uc_cart_links/uc_cart_links.install \uc_cart_links_schema()
  2. 7.3 uc_cart_links/uc_cart_links.install \uc_cart_links_schema()

Implements hook_schema().

File

uc_cart_links/uc_cart_links.install, line 11
Install, update and uninstall functions for the uc_cart_links module.

Code

function uc_cart_links_schema() {
  $schema['uc_cart_link_clicks'] = [
    'description' => 'Stores information for cart links.',
    'fields' => [
      'cart_link_id' => [
        'description' => 'The cart link identifier.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '0',
      ],
      'clicks' => [
        'description' => 'The number of times this cart link was clicked.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ],
      'last_click' => [
        'description' => 'The time of the last click on this cart link, stored as a UNIX timestamp.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ],
    ],
    'primary key' => [
      'cart_link_id',
    ],
  ];
  return $schema;
}