Skip to content

Commit 8b04168

Browse files
committed
Resolve laravel-portugal#31 - An authenticated user can post an answer to a question (Request Changed)
1 parent 155e117 commit 8b04168

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
<?php
22

3-
use Domains\Discussions\Models\Question;
43
use Domains\Accounts\Models\User;
4+
use Domains\Discussions\Models\Question;
55
use Illuminate\Database\Migrations\Migration;
66
use Illuminate\Database\Schema\Blueprint;
77
use Illuminate\Support\Facades\Schema;
88

99
class CreateQuestionAnswersTable extends Migration
1010
{
11-
/**
12-
* Run the migrations.
13-
*
14-
* @return void
15-
*/
16-
public function up()
11+
public function up(): void
1712
{
1813
Schema::create('question_answers', function (Blueprint $table) {
1914
$table->id();
@@ -23,8 +18,7 @@ public function up()
2318
$table->timestampsTz();
2419
$table->softDeletesTz();
2520

26-
$table->index('question_id');
27-
$table->index('author_id');
21+
$table->index(['question_id', 'author_id', 'created_at']);
2822
});
2923
}
3024
}

0 commit comments

Comments
 (0)