You are here

function userpoints_update_7003 in User Points 7

Same name and namespace in other branches
  1. 7.2 userpoints.install \userpoints_update_7003()

Create the {userpoints_total} table.

File

./userpoints.install, line 274
Install time hook userpoints module.

Code

function userpoints_update_7003() {
  db_create_table('userpoints_total', array(
    'description' => 'Holds the total user points',
    'fields' => array(
      'uid' => array(
        'description' => 'User ID',
        'type' => 'int',
        'not null' => TRUE,
      ),
      'points' => array(
        'description' => 'Current Points',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'max_points' => array(
        'description' => 'Out of a maximum points',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'last_update' => array(
        'description' => 'Timestamp',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'uid',
    ),
    'indexes' => array(
      'last_update' => array(
        'last_update',
      ),
      'points' => array(
        'points',
      ),
    ),
  ));
}