|
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
-class AddIndexToTableFeed extends Migration
|
|
|
|
|
|
+class AddIndexToTableFeeds extends Migration
|
|
{
|
|
{
|
|
/**
|
|
/**
|
|
* Run the migrations.
|
|
* Run the migrations.
|
|
@@ -13,9 +13,11 @@ class AddIndexToTableFeed extends Migration
|
|
*/
|
|
*/
|
|
public function up()
|
|
public function up()
|
|
{
|
|
{
|
|
- Schema::table('feed', function (Blueprint $table) {
|
|
|
|
- $table->index(['uid', 'follow_uid', 'type', 'relate_id'],'idx_search');
|
|
|
|
- });
|
|
|
|
|
|
+ for($i = 0; $i < 10; $i++){
|
|
|
|
+ Schema::table('feed_'.$i, function (Blueprint $table) {
|
|
|
|
+ $table->index(['uid', 'follow_uid', 'type', 'relate_id'],'idx_search');
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -25,7 +27,7 @@ class AddIndexToTableFeed extends Migration
|
|
*/
|
|
*/
|
|
public function down()
|
|
public function down()
|
|
{
|
|
{
|
|
- Schema::table('feed', function (Blueprint $table) {
|
|
|
|
|
|
+ Schema::table('table_feeds', function (Blueprint $table) {
|
|
//
|
|
//
|
|
});
|
|
});
|
|
}
|
|
}
|