Files
marechai/Marechai.Database/Migrations/20260508192040_AddProcessorPhotosProcessorIdIndex.cs
Natalia Portillo a331adb485 Add consolidated endpoint for processor details
- Introduced a new endpoint `/processors/{id}/full` in `ProcessorsController` to fetch processor details, including associated machines, photos, and videos in a single request, reducing multiple round-trips to the server.
- Updated `ProcessorsService` to include a method for fetching the consolidated processor data.
- Modified the `View` component to utilize the new consolidated endpoint, improving performance by minimizing API calls.
- Added new database indexes for `ProcessorPhotos` to optimize queries related to processor photos.
- Updated migration files to reflect changes in database schema and indexes.
2026-05-08 20:52:26 +01:00

38 lines
1.2 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marechai.Database.Migrations
{
/// <inheritdoc />
public partial class AddProcessorPhotosProcessorIdIndex : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameIndex(
name: "IX_ProcessorPhotos_ProcessorId",
table: "ProcessorPhotos",
newName: "idx_processor_photos_processor");
migrationBuilder.CreateIndex(
name: "idx_processor_photos_processor_created",
table: "ProcessorPhotos",
columns: new[] { "ProcessorId", "CreatedOn", "Id" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "idx_processor_photos_processor_created",
table: "ProcessorPhotos");
migrationBuilder.RenameIndex(
name: "idx_processor_photos_processor",
table: "ProcessorPhotos",
newName: "IX_ProcessorPhotos_ProcessorId");
}
}
}