add last login column to users table

pull/2893/head
HB9HIL 2024-01-01 02:07:47 +01:00
rodzic 8298e1bfcf
commit e498f85074
2 zmienionych plików z 23 dodań i 1 usunięć

Wyświetl plik

@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
*/
$config['migration_version'] = 166;
$config['migration_version'] = 167;
/*
|--------------------------------------------------------------------------

Wyświetl plik

@ -0,0 +1,22 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
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');
}
}