File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use Illuminate \Database \Schema \Blueprint ;
4
+ use Illuminate \Database \Migrations \Migration ;
5
+
6
+ class AddIndexes extends Migration
7
+ {
8
+ /**
9
+ * Run the migrations.
10
+ *
11
+ * @return void
12
+ */
13
+ public function up ()
14
+ {
15
+ Schema::table ('forum_threads ' , function (Blueprint $ table ) {
16
+ $ table ->index ('author_id ' );
17
+ $ table ->index ('most_recent_reply_id ' );
18
+ $ table ->index ('solution_reply_id ' );
19
+ });
20
+
21
+ Schema::table ('forum_replies ' , function (Blueprint $ table ) {
22
+ $ table ->index ('author_id ' );
23
+ $ table ->index ('thread_id ' );
24
+ });
25
+
26
+ Schema::table ('comments ' , function (Blueprint $ table ) {
27
+ $ table ->index ('author_id ' );
28
+ });
29
+ }
30
+
31
+ /**
32
+ * Reverse the migrations.
33
+ *
34
+ * @return void
35
+ */
36
+ public function down ()
37
+ {
38
+ Schema::table ('forum_threads ' , function (Blueprint $ table ) {
39
+ $ table ->dropIndex ('author_id ' );
40
+ $ table ->dropIndex ('most_recent_reply_id ' );
41
+ $ table ->dropIndex ('solution_reply_id ' );
42
+ });
43
+
44
+ Schema::table ('forum_replies ' , function (Blueprint $ table ) {
45
+ $ table ->dropIndex ('author_id ' );
46
+ $ table ->dropIndex ('thread_id ' );
47
+ });
48
+
49
+ Schema::table ('comments ' , function (Blueprint $ table ) {
50
+ $ table ->dropIndex ('author_id ' );
51
+ });
52
+ }
53
+ }
You can’t perform that action at this time.
0 commit comments