2024-01-01 01:07:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
|
2024-01-01 01:44:03 +00:00
|
|
|
// Adding a column to users table for the timestamp of the last login
|
|
|
|
|
2024-01-01 01:07:47 +00:00
|
|
|
class Migration_add_last_login extends CI_Migration
|
|
|
|
{
|
|
|
|
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
if (!$this->db->field_exists('last_login_date', 'users')) {
|
|
|
|
$fields = array(
|
|
|
|
'last_login_date TIMESTAMP NULL DEFAULT NULL AFTER `reset_password_date`',
|
|
|
|
);
|
|
|
|
$this->dbforge->add_column('users', $fields);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
$this->dbforge->drop_column('users', 'last_login_date');
|
|
|
|
}
|
|
|
|
}
|