first commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AddEmailVerificationToUsers extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
// Добавляем поля для верификации email
|
||||
$fields = [
|
||||
'verification_token' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
'null' => true,
|
||||
'comment' => 'Токен для подтверждения email',
|
||||
],
|
||||
'email_verified' => [
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 1,
|
||||
'default' => 0,
|
||||
'comment' => 'Статус подтверждения email (0 - не подтвержден, 1 - подтвержден)',
|
||||
],
|
||||
'verified_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
'comment' => 'Дата и время подтверждения email',
|
||||
],
|
||||
];
|
||||
|
||||
$this->forge->addColumn('users', $fields);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn('users', ['verification_token', 'email_verified', 'verified_at']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user