fix(backend): harden sanctum auth, remove dead models, add composite indexes and optimize homepage queries
Deploy Backend / deploy (push) Successful in 48s
Deploy Backend / deploy (push) Successful in 48s
This commit is contained in:
1 parent
5e6647d812
commit
accf0b6aab
8 files changed
+71
-75
No files matched your search
@@ -0,0 +1,32 @@
|
||||
<?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('posts', function (Blueprint $table) {
|
||||
$table->index(['published_at', 'views'], 'posts_published_at_views_idx');
|
||||
$table->index(['category_id', 'published_at'], 'posts_category_id_published_at_idx');
|
||||
$table->index(['author_id', 'published_at'], 'posts_author_id_published_at_idx');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('posts', function (Blueprint $table) {
|
||||
$table->dropIndex('posts_published_at_views_idx');
|
||||
$table->dropIndex('posts_category_id_published_at_idx');
|
||||
$table->dropIndex('posts_author_id_published_at_idx');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user