You are here

function cas_update_7103 in CAS 7

Add created column to cas_login_data table.

File

./cas.install, line 413
Installation hooks for the CAS module.

Code

function cas_update_7103() {
  db_add_field('cas_login_data', 'created', array(
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
    'description' => 'Timestamp when this record was created.',
  ));
  $now = time();

  // Assume that all data was inserted today. This is obviously not true, but
  // it will prevent us from deleting the existing data for some time, since
  // the cron task will only delete data older than X days.
  db_update('cas_login_data')
    ->fields(array(
    'created' => $now,
  ))
    ->execute();
}