]> git.localhorst.tv Git - alttp.git/commitdiff
record discord channel parent
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 27 Apr 2022 13:59:48 +0000 (15:59 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 27 Apr 2022 13:59:48 +0000 (15:59 +0200)
app/Models/DiscordChannel.php
database/migrations/2022_04_27_135554_add_channel_parent.php [new file with mode: 0644]

index ba3d3176710608e5996bdbaec253c0dcdab3e825..ab699a7cd4e892e591e72e6571ed60793bf27097 100644 (file)
@@ -38,6 +38,7 @@ class DiscordChannel extends Model
                $model->type = $channel->type;
                $model->position = $channel->position;
                $model->private = $channel->is_private;
+               $model->parent_id = $channel->parent_id;
                $model->save();
        }
 
diff --git a/database/migrations/2022_04_27_135554_add_channel_parent.php b/database/migrations/2022_04_27_135554_add_channel_parent.php
new file mode 100644 (file)
index 0000000..2bf99f0
--- /dev/null
@@ -0,0 +1,32 @@
+<?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('discord_channels', function(Blueprint $table) {
+                       $table->string('parent_id')->nullable()->default(null);
+               });
+       }
+
+       /**
+        * Reverse the migrations.
+        *
+        * @return void
+        */
+       public function down()
+       {
+               Schema::table('discord_channels', function(Blueprint $table) {
+                       $table->dropColumn('parent_id');
+               });
+       }
+};