You are here

function shurly_update_7103 in ShURLy 7

Adding the new history table to shurly to allow editing of short urls.

File

./shurly.install, line 232
Shurly install file

Code

function shurly_update_7103() {
  $schema['shurly_history'] = array(
    'description' => t('Stores a history of the various shortlinks.  Rows are created when they are edited, so we can see what a row once was.'),
    'fields' => array(
      'hid' => array(
        'description' => t('Unique history ID.'),
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'rid' => array(
        'description' => t('The redirect ID.'),
        'type' => 'int',
        'not null' => TRUE,
      ),
      'vid' => array(
        'description' => t('The version for the change made.'),
        'type' => 'int',
        'not null' => TRUE,
      ),
      'source' => array(
        'description' => t('Source path.'),
        'type' => 'varchar',
        'length' => '2048',
        'binary' => TRUE,
        'not null' => TRUE,
      ),
      'destination' => array(
        'description' => t('Redirect URL.'),
        'type' => 'text',
        'not null' => TRUE,
      ),
      'last_date' => array(
        'description' => t('Datestamp that this link was edited from the value in this row.'),
        'type' => 'int',
        'not null' => TRUE,
      ),
      'count' => array(
        'description' => t('Usage count.'),
        'type' => 'int',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'hid',
    ),
    'indexes' => array(
      'source' => array(
        'rid',
        'vid',
      ),
    ),
  );
  db_create_table('shurly_history', $schema['shurly_history']);
}