I need to create a module to save data of term page visits.
<?php
function term_count_schema() {
$schema['term_search'] = array(
'description' => 'Stores timestamp range..',
'fields' => array(
'tid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'Taxonomy ID.',
),
'vid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'Vocabulary ID.',
),
'timestamp' => array(
'type' => 'int',
'not null' => FALSE,
'description' => 'UNIX timestamp.',
),
),
'primary key' => array('tid'),
);
$schema['term_count'] = array(
'description' => 'Total views.',
'fields' => array(
'tid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'Taxonomay ID.',
),
'vid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'Vocabulary ID.',
),
'totalviews' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'Total number of views which increments on every page load.',
),
),
'primary key' => array('tid'),
);
return $schema;
}
This is not creating tables term_search & term_count ind DB. Any thing wrong in my code.