| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- class ChangeLogIndexAll extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::table('logs', function (Blueprint $table) {
- $table->index('created_at','index_logs_created_at');
- $table->index(['method','created_at'],'index_logs_m_c');
- $table->index(['type','created_at'],'index_logs_t_c');
- $table->dropIndex('index_logs_c_c');
- $table->dropIndex('index_logs_c_t');
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::table('logs', function (Blueprint $table) {
- $table->dropIndex('index_logs_created_at');
- $table->dropIndex('index_logs_m_c');
- $table->dropIndex('index_logs_t_c');
- $table->index(['type','created_at'],'index_logs_t_c');
- $table->index(['created_at','type'],'index_logs_c_t');
- });
- }
- }
|