diff --git a/.env.example b/.env.example index eb6be035..a2b3ad0c 100644 --- a/.env.example +++ b/.env.example @@ -25,10 +25,10 @@ DB_USERNAME=root DB_PASSWORD= BROADCAST_CONNECTION=log -CACHE_STORE=file +CACHE_STORE=database FILESYSTEM_DISK=local QUEUE_CONNECTION=database -SESSION_DRIVER=file +SESSION_DRIVER=database SESSION_LIFETIME=120 MEMCACHED_HOST=127.0.0.1 diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index 9e22f06d..05fb5d9e 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -26,6 +26,15 @@ return new class extends Migration $table->string('token'); $table->timestamp('created_at')->nullable(); }); + + Schema::create('sessions', function (Blueprint $table) { + $table->string('id')->primary(); + $table->foreignId('user_id')->nullable()->index(); + $table->string('ip_address', 45)->nullable(); + $table->text('user_agent')->nullable(); + $table->longText('payload'); + $table->integer('last_activity')->index(); + }); } /** @@ -35,5 +44,6 @@ return new class extends Migration { Schema::dropIfExists('users'); Schema::dropIfExists('password_reset_tokens'); + Schema::dropIfExists('sessions'); } }; diff --git a/database/migrations/0001_01_01_000002_create_cache_table.php b/database/migrations/0001_01_01_000002_create_cache_table.php new file mode 100644 index 00000000..b9c106be --- /dev/null +++ b/database/migrations/0001_01_01_000002_create_cache_table.php @@ -0,0 +1,35 @@ +string('key')->primary(); + $table->mediumText('value'); + $table->integer('expiration'); + }); + + Schema::create('cache_locks', function (Blueprint $table) { + $table->string('key')->primary(); + $table->string('owner'); + $table->integer('expiration'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('cache'); + Schema::dropIfExists('cache_locks'); + } +}; diff --git a/database/migrations/0001_01_01_000001_create_jobs_table.php b/database/migrations/0001_01_01_000003_create_jobs_table.php similarity index 100% rename from database/migrations/0001_01_01_000001_create_jobs_table.php rename to database/migrations/0001_01_01_000003_create_jobs_table.php