]> git.localhorst.tv Git - alttp.git/blobdiff - database/migrations/2024_04_09_122502_create_chat_bot_logs_table.php
protocol chat bot messages
[alttp.git] / database / migrations / 2024_04_09_122502_create_chat_bot_logs_table.php
diff --git a/database/migrations/2024_04_09_122502_create_chat_bot_logs_table.php b/database/migrations/2024_04_09_122502_create_chat_bot_logs_table.php
new file mode 100644 (file)
index 0000000..3845b01
--- /dev/null
@@ -0,0 +1,31 @@
+<?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('chat_bot_logs', function (Blueprint $table) {
+                       $table->id();
+                       $table->timestamps();
+                       $table->foreignId('channel_id')->constrained();
+                       $table->foreignId('origin_id')->nullable()->default(null);
+                       $table->string('origin_type')->nullable()->default(null);
+                       $table->text('text');
+               });
+       }
+
+       /**
+        * Reverse the migrations.
+        */
+       public function down(): void
+       {
+               Schema::dropIfExists('chat_bot_logs');
+       }
+};