Skip to content

Commit

Permalink
patch index's
Browse files Browse the repository at this point in the history
  • Loading branch information
Babichev Maxim committed Nov 8, 2018
1 parent 5f46d5b commit 789b012
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public function up(): void
$table->uuid('uuid')->unique();
$table->timestamps();

$table->index(['payable_type', 'payable_id', 'type']);
$table->index(['payable_type', 'payable_id', 'confirmed']);
$table->index(['payable_type', 'payable_id', 'type', 'confirmed']);
$table->index(['payable_type', 'payable_id', 'type'], 'payable_type_ind');
$table->index(['payable_type', 'payable_id', 'confirmed'], 'payable_confirmed_ind');
$table->index(['payable_type', 'payable_id', 'type', 'confirmed'], 'payable_type_confirmed_ind');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public function up(): void
->after('withdraw_id')
->default(0);

$table->index(['from_type', 'from_id', 'to_type', 'to_id', 'refund']);
$table->index(['from_type', 'from_id', 'refund']);
$table->index(['to_type', 'to_id', 'refund']);
$table->index(['from_type', 'from_id', 'to_type', 'to_id', 'refund'], 'from_to_refund_ind');
$table->index(['from_type', 'from_id', 'refund'], 'from_refund_ind');
$table->index(['to_type', 'to_id', 'refund'], 'to_refund_ind');
});
}

Expand All @@ -38,6 +38,9 @@ public function up(): void
public function down(): void
{
Schema::table($this->table(), function(Blueprint $table) {
$table->dropIndex('from_to_refund_ind');
$table->dropIndex('from_refund_ind');
$table->dropIndex('to_refund_ind');
$table->dropColumn('refund');
});
}
Expand Down

0 comments on commit 789b012

Please sign in to comment.