mirror of
https://github.com/claunia/marechai.git
synced 2026-07-08 17:57:08 +00:00
- 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.
38 lines
1.2 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|