2022-01-18 15:29:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class Migration_create_eqsl_images_table
|
|
|
|
*
|
|
|
|
* Creates columnns reset_password_code and reset_password_time in the users table
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
class Migration_add_reset_pass_to_users extends CI_Migration {
|
|
|
|
|
|
|
|
public function up()
|
|
|
|
{
|
2022-02-09 19:05:40 +00:00
|
|
|
if (!$this->db->field_exists('reset_password_code', 'users')) {
|
|
|
|
$fields = array(
|
|
|
|
'reset_password_code varchar(50) DEFAULT NULL',
|
|
|
|
);
|
|
|
|
$this->dbforge->add_column('users', $fields);
|
|
|
|
}
|
2022-01-18 15:29:22 +00:00
|
|
|
|
2022-02-09 19:05:40 +00:00
|
|
|
if (!$this->db->field_exists('reset_password_date', 'users')) {
|
|
|
|
$fields = array(
|
|
|
|
'reset_password_date TIMESTAMP NULL DEFAULT NULL',
|
|
|
|
);
|
|
|
|
$this->dbforge->add_column('users', $fields);
|
|
|
|
}
|
2022-01-18 15:29:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
$this->dbforge->drop_column('users', 'reset_password_code');
|
|
|
|
$this->dbforge->drop_column('users', 'reset_password_date');
|
|
|
|
}
|
2022-01-18 17:55:59 +00:00
|
|
|
}
|