fix: adding indexes to tables

This commit is contained in:
2023-12-18 09:44:09 -06:00
parent d5c7e9e4f5
commit 7772be7dc5
10 changed files with 255 additions and 113 deletions

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('artworks', function (Blueprint $table) {
$table->index('podcast_id');
$table->index('artist_id');
$table->index('episode_id');
$table->index('legacy_id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('artworks', function (Blueprint $table) {
$table->dropIndex('podcast_id');
$table->dropIndex('artist_id');
$table->dropIndex('episode_id');
$table->dropIndex('legacy_id');
});
}
};

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('artists', function (Blueprint $table) {
$table->index('user_id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('artists', function (Blueprint $table) {
$table->dropIndex('user_id');
});
}
};

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('podcasts', function (Blueprint $table) {
$table->index('published');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('podcasts', function (Blueprint $table) {
$table->dropIndex('published');
});
}
};

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('episodes', function (Blueprint $table) {
$table->index('podcast_id');
$table->index('artwork_id');
$table->index('episode_date');
$table->index('published');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('episodes', function (Blueprint $table) {
$table->dropIndex('podcast_id');
$table->dropIndex('artwork_id');
$table->dropIndex('episode_date');
$table->dropIndex('published');
});
}
};