]> git.localhorst.tv Git - alttp.git/commitdiff
alttp seeds table
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sat, 14 May 2022 12:53:44 +0000 (14:53 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sat, 14 May 2022 12:53:44 +0000 (14:53 +0200)
app/Models/AlttpSeed.php [new file with mode: 0644]
database/migrations/2022_05_14_121327_create_alttp_seeds_table.php [new file with mode: 0644]

diff --git a/app/Models/AlttpSeed.php b/app/Models/AlttpSeed.php
new file mode 100644 (file)
index 0000000..b160697
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+
+class AlttpSeed extends Model
+{
+       use HasFactory;
+
+       protected $casts = [
+               'error_detail' => 'array',
+               'mystery' => 'boolean',
+               'race' => 'boolean',
+               'settings' => 'array',
+       ];
+
+}
diff --git a/database/migrations/2022_05_14_121327_create_alttp_seeds_table.php b/database/migrations/2022_05_14_121327_create_alttp_seeds_table.php
new file mode 100644 (file)
index 0000000..eb91025
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+       /**
+        * Run the migrations.
+        *
+        * @return void
+        */
+       public function up()
+       {
+               Schema::create('alttp_seeds', function (Blueprint $table) {
+                       $table->id();
+                       $table->binary('hash');
+                       $table->string('generator');
+                       $table->string('preset');
+                       $table->boolean('race')->default(false);
+                       $table->boolean('mystery')->default(false);
+                       $table->string('seed');
+                       $table->text('settings');
+                       $table->string('status')->default('pending');
+                       $table->text('error_detail')->nullable()->default(null);
+                       $table->timestamps();
+                       $table->unique('hash');
+               });
+       }
+
+       /**
+        * Reverse the migrations.
+        *
+        * @return void
+        */
+       public function down()
+       {
+               Schema::dropIfExists('alttp_seeds');
+       }
+};