function scanner_schema in Search and Replace Scanner 6
Same name and namespace in other branches
- 8 scanner.install \scanner_schema()
- 7 scanner.install \scanner_schema()
Implementation of hook_schema().
File
- ./
scanner.install, line 12 - Search and Replace Scanner install - creates necessary tables.
Code
function scanner_schema() {
$schema['scanner'] = array(
'description' => t('Holds info on recent replacements in case undo is needed.'),
'fields' => array(
'undo_id' => array(
'description' => t('Row identifier'),
'type' => 'serial',
'not null' => TRUE,
),
'undo_data' => array(
'description' => t('What was changed'),
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
'undone' => array(
'description' => t('Whether the replacement has been undone'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
),
'searched' => array(
'description' => t('Text that was searched for'),
'type' => 'varchar',
'length' => 256,
'not null' => TRUE,
),
'replaced' => array(
'description' => t('Text that was used as replacement'),
'type' => 'varchar',
'length' => 256,
'not null' => TRUE,
),
'count' => array(
'description' => t('How many fields were modified on replacement'),
'type' => 'int',
'not null' => TRUE,
),
'time' => array(
'description' => t('How long the replacement took'),
'type' => 'int',
'not null' => TRUE,
),
),
'primary key' => array(
'undo_id',
),
);
return $schema;
}