33 lines
752 B
PHP
33 lines
752 B
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class AddPasswordResetFieldsToUsers extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
$fields = [
|
|
'reset_token' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 255,
|
|
'null' => true,
|
|
'after' => 'verified_at',
|
|
],
|
|
'reset_expires_at' => [
|
|
'type' => 'DATETIME',
|
|
'null' => true,
|
|
'after' => 'reset_token',
|
|
],
|
|
];
|
|
|
|
$this->forge->addColumn('users', $fields);
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
$this->forge->dropColumn('users', ['reset_token', 'reset_expires_at']);
|
|
}
|
|
}
|