]> git.localhorst.tv Git - alttp.git/blobdiff - database/migrations/2024_02_18_150400_chat_classification.php
simple chat classification
[alttp.git] / database / migrations / 2024_02_18_150400_chat_classification.php
diff --git a/database/migrations/2024_02_18_150400_chat_classification.php b/database/migrations/2024_02_18_150400_chat_classification.php
new file mode 100644 (file)
index 0000000..ad67e8d
--- /dev/null
@@ -0,0 +1,33 @@
+<?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('chat_logs', function (Blueprint $table) {
+                       $table->string('classification')->default('unclassified');
+                       $table->index(['classification']);
+               });
+       }
+
+       /**
+        * Reverse the migrations.
+        *
+        * @return void
+        */
+       public function down()
+       {
+               Schema::table('chat_logs', function (Blueprint $table) {
+                       $table->dropColumn('classification');
+               });
+       }
+};