1: <?php
2:
3: use Illuminate\Database\Migrations\Migration;
4: use Illuminate\Database\Schema\Blueprint;
5: use Illuminate\Database\Capsule\Manager as Capsule;
6:
7: class CreateMailIndexes extends Migration
8: {
9: /**
10: * Run the migrations.
11: *
12: * @return void
13: */
14: public function up()
15: {
16: Capsule::schema()->table('mail_accounts', function (Blueprint $table) {
17: $table->index('IdUser');
18: });
19:
20: Capsule::schema()->table('mail_identities', function (Blueprint $table) {
21: $table->index('IdUser');
22: $table->index('IdAccount');
23: });
24: }
25:
26: /**
27: * Reverse the migrations.
28: *
29: * @return void
30: */
31: public function down()
32: {
33: Capsule::schema()->table('mail_accounts', function (Blueprint $table) {
34: $table->dropIndex(['IdUser']);
35: });
36:
37: Capsule::schema()->table('mail_identities', function (Blueprint $table) {
38: $table->dropIndex(['IdUser']);
39: $table->dropIndex(['IdAccount']);
40: });
41: }
42: }
43: