aboutsummaryrefslogtreecommitdiff
path: root/database/migrations/2025_03_06_091820_create_players_table.php
diff options
context:
space:
mode:
authorryo <ryo@nopwd.lol>2025-03-06 13:06:42 +0000
committerryo <ryo@nopwd.lol>2025-03-06 13:06:42 +0000
commite1a48c8208c181fd40ecb065878ba9ea49b1f48f (patch)
treed7a0cafef9d406dd21a694ed60ab6f1ea034335f /database/migrations/2025_03_06_091820_create_players_table.php
Initial Commit
Diffstat (limited to 'database/migrations/2025_03_06_091820_create_players_table.php')
-rw-r--r--database/migrations/2025_03_06_091820_create_players_table.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/database/migrations/2025_03_06_091820_create_players_table.php b/database/migrations/2025_03_06_091820_create_players_table.php
new file mode 100644
index 0000000..d078edf
--- /dev/null
+++ b/database/migrations/2025_03_06_091820_create_players_table.php
@@ -0,0 +1,40 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ */
+ public function up(): void
+ {
+ Schema::create('players', function (Blueprint $table) {
+ $table->id();
+ $table->timestamps();
+ $table->string('name');
+ $table->string('team');
+ $table->integer('score');
+ });
+
+ 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();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::dropIfExists('players');
+ Schema::dropIfExists('sessions');
+ }
+};