You are here

function cleantalk_update_7200 in Anti Spam by CleanTalk 7.2

Add new table for SpamFireWall logs

File

./cleantalk.install, line 236
Install and uninstall functions for the CleanTalk module.

Code

function cleantalk_update_7200(&$sandbox = NULL) {
  variable_set('ct_sfw_last_logs_sent', time());
  db_drop_table('cleantalk_sfw_logs');
  $cleantalk_sfw_logs = array(
    'description' => 'Comment checking results - CIDs and server responces.',
    'fields' => array(
      'ip' => array(
        'type' => 'varchar',
        'length' => 15,
        'not null' => TRUE,
        'default' => '',
        'description' => 'IP.',
      ),
      'all' => array(
        'type' => 'int',
        'description' => 'All entries.',
      ),
      'blocked' => array(
        'type' => 'int',
        'description' => 'Blocked entries.',
      ),
      'timestamp' => array(
        'type' => 'int',
        'description' => 'time().',
      ),
    ),
    'primary key' => array(
      'ip',
    ),
  );
  db_create_table('cleantalk_sfw_logs', $cleantalk_sfw_logs);
  return '* New table for SpamFireWall logs added.';
}