user profile

This commit is contained in:
root
2026-01-13 07:11:21 +03:00
parent 24ea8deeec
commit 3d39c1ba07
12 changed files with 1312 additions and 47 deletions
@@ -0,0 +1,61 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateRememberTokensTable extends Migration
{
public function up()
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true,
],
'user_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
],
'selector' => [
'type' => 'VARCHAR',
'constraint' => 64,
],
'token_hash' => [
'type' => 'VARCHAR',
'constraint' => 128,
],
'expires_at' => [
'type' => 'DATETIME',
],
'created_at' => [
'type' => 'DATETIME',
'null' => true,
],
'user_agent' => [
'type' => 'VARCHAR',
'constraint' => 500,
'null' => true,
],
'ip_address' => [
'type' => 'VARCHAR',
'constraint' => 45,
'null' => true,
],
]);
$this->forge->addKey('id', true);
$this->forge->addKey('user_id');
$this->forge->addKey('selector');
$this->forge->addKey('expires_at');
$this->forge->addForeignKey('user_id', 'users', 'id', false, 'CASCADE');
$this->forge->createTable('remember_tokens');
}
public function down()
{
$this->forge->dropTable('remember_tokens');
}
}