2018-09-15 17:24:59 +02:00
|
|
|
<?php
|
|
|
|
|
2023-02-03 20:41:59 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2018-10-24 13:35:31 +02:00
|
|
|
namespace Engelsystem\Migrations;
|
|
|
|
|
2018-09-15 17:24:59 +02:00
|
|
|
use Engelsystem\Database\Migration\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
|
|
|
class CreateSessionsTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migration
|
|
|
|
*/
|
2022-12-14 19:15:20 +01:00
|
|
|
public function up(): void
|
2018-09-15 17:24:59 +02:00
|
|
|
{
|
2022-12-14 19:15:20 +01:00
|
|
|
$this->schema->create('sessions', function (Blueprint $table): void {
|
2018-09-15 17:24:59 +02:00
|
|
|
$table->string('id')->unique();
|
|
|
|
$table->text('payload');
|
2018-09-16 14:08:09 +02:00
|
|
|
$table->dateTime('last_activity')->useCurrent();
|
2018-09-15 17:24:59 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migration
|
|
|
|
*/
|
2022-12-14 19:15:20 +01:00
|
|
|
public function down(): void
|
2018-09-15 17:24:59 +02:00
|
|
|
{
|
|
|
|
$this->schema->dropIfExists('sessions');
|
|
|
|
}
|
|
|
|
}
|