aboutsummaryrefslogtreecommitdiff
path: root/database/migrations/2025_03_08_132951_create_players_table.php
diff options
context:
space:
mode:
authorryo <ryo@nopwd.lol>2025-03-11 16:15:29 +0000
committerryo <ryo@nopwd.lol>2025-03-11 16:15:29 +0000
commitfa4823dd632cad6a5736c1d900a064647bb72c20 (patch)
treea716b9d9f0ce62a9d2ca53f11d64b2a39b178d6c /database/migrations/2025_03_08_132951_create_players_table.php
parente1a48c8208c181fd40ecb065878ba9ea49b1f48f (diff)
Added admin user that can change usres teamHEADmain
Fixed: player login based on user and password Added: show errors to the user
Diffstat (limited to 'database/migrations/2025_03_08_132951_create_players_table.php')
-rw-r--r--database/migrations/2025_03_08_132951_create_players_table.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/database/migrations/2025_03_08_132951_create_players_table.php b/database/migrations/2025_03_08_132951_create_players_table.php
new file mode 100644
index 0000000..13d4e24
--- /dev/null
+++ b/database/migrations/2025_03_08_132951_create_players_table.php
@@ -0,0 +1,43 @@
+<?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->rememberToken();
+ $table->string('name')->unique();
+ $table->string('password');
+ $table->string('team');
+ $table->integer('score');
+ $table->boolean('is_admin')->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();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::dropIfExists('players');
+ Schema::dropIfExists('sessions');
+ }
+};