update
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class CreateRememberTokens extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
$this->forge->addField([
|
||||
'id' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true],
|
||||
'selector' => ['type' => 'VARCHAR', 'constraint' => 32],
|
||||
'validator_hash' => ['type' => 'CHAR', 'constraint' => 64],
|
||||
'expires_at' => ['type' => 'DATETIME'],
|
||||
'created_at' => ['type' => 'DATETIME', 'null' => true],
|
||||
'updated_at' => ['type' => 'DATETIME', 'null' => true],
|
||||
]);
|
||||
$this->forge->addKey('id', true);
|
||||
$this->forge->addUniqueKey('selector');
|
||||
$this->forge->addKey('expires_at');
|
||||
$this->forge->createTable('remember_tokens', true, ['ENGINE' => 'InnoDB']);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
$this->forge->dropTable('remember_tokens', true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user