Skip to content

Commit

Permalink
Merge branch 'hotfix/fix_db_indexes'
Browse files Browse the repository at this point in the history
  • Loading branch information
thes01 committed Mar 14, 2021
2 parents d9d1c6e + 10eb4dc commit ff66146
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions database/migrations/2021_03_14_072504_add_indexes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddIndexes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('song_lyrics', function (Blueprint $table) {
$table->index('updated_at');
});

Schema::table('taggables', function (Blueprint $table) {
$table->index('taggable_type');
$table->index('taggable_id');
});

Schema::table('tags', function (Blueprint $table) {
$table->index('type');
});

Schema::table('liturgical_year_readings', function (Blueprint $table) {
$table->index('date');
});

Schema::table('authors', function (Blueprint $table) {
$table->index('type');
});

Schema::table('externals', function (Blueprint $table) {
$table->index('media_type');
$table->index('content_type');
$table->index('is_uploaded');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('song_lyrics', function (Blueprint $table) {
$table->dropIndex(['updated_at']);
});

Schema::table('taggables', function (Blueprint $table) {
$table->dropIndex(['taggable_type']);
$table->dropIndex(['taggable_id']);
});

Schema::table('tags', function (Blueprint $table) {
$table->dropIndex(['type']);
});

Schema::table('liturgical_year_readings', function (Blueprint $table) {
$table->dropIndex(['date']);
});

Schema::table('authors', function (Blueprint $table) {
$table->dropIndex(['type']);
});

Schema::table('externals', function (Blueprint $table) {
$table->dropIndex(['media_type']);
$table->dropIndex(['content_type']);
$table->dropIndex(['is_uploaded']);
});
}
}

0 comments on commit ff66146

Please sign in to comment.