File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use Illuminate\Database\Migrations\Migration;
4
+ use Illuminate\Database\Schema\Blueprint;
5
+ use Illuminate\Support\Facades\Schema;
6
+
7
+ return new class extends Migration
8
+ {
9
+ public function up(): void
10
+ {
11
+ Schema::table('filament_comments', function (Blueprint $table) {
12
+ $table->index(['subject_type', 'subject_id']);
13
+ });
14
+ }
15
+
16
+ public function down(): void
17
+ {
18
+ Schema::table('filament_comments', function (Blueprint $table) {
19
+ $table->dropIndex(['subject_type', 'subject_id']);
20
+ });
21
+ }
22
+ };
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ return new class extends Migration
11
11
Schema::create('filament_comments', function (Blueprint $table) {
12
12
$table->id();
13
13
$table->unsignedBigInteger('user_id');
14
- $table->morphs('subject');
14
+ $table->string('subject_type');
15
+ $table->unsignedBigInteger('subject_id');
15
16
$table->longText('comment');
16
17
$table->timestamps();
17
18
$table->softDeletes();
You can’t perform that action at this time.
0 commit comments