]> git.localhorst.tv Git - alttp.git/blobdiff - database/migrations/2022_08_19_080601_tech_index.php
add index option for tech sites
[alttp.git] / database / migrations / 2022_08_19_080601_tech_index.php
diff --git a/database/migrations/2022_08_19_080601_tech_index.php b/database/migrations/2022_08_19_080601_tech_index.php
new file mode 100644 (file)
index 0000000..d1b6d6e
--- /dev/null
@@ -0,0 +1,34 @@
+<?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::table('techniques', function(Blueprint $table) {
+                       $table->boolean('index')->default(false);
+                       $table->float('priority')->default(0.5);
+               });
+       }
+
+       /**
+        * Reverse the migrations.
+        *
+        * @return void
+        */
+       public function down()
+       {
+               Schema::table('rounds', function(Blueprint $table) {
+                       $table->dropColumn('index');
+                       $table->dropColumn('priority');
+               });
+       }
+};