Files
marechai/Marechai.Database/Migrations/20260322225211_AddSortTitleToDocumentBase.cs
Natalia Portillo 10d5542ee0 Add SortTitle field to DocumentBase and related entities
- Added a new column 'SortTitle' to the 'Magazines', 'Documents', and 'Books' tables in the database.
- Updated the MarechaiContextModelSnapshot to reflect the new 'SortTitle' property.
- Modified the DocumentBase model to include the 'SortTitle' property.
- Updated BooksController, DocumentsController, and MagazinesController to sort by 'SortTitle' instead of 'NativeTitle'.
- Included 'SortTitle' in the DTOs for Books, Documents, and Magazines to ensure data consistency.
2026-03-22 23:01:22 +00:00

52 lines
1.5 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marechai.Database.Migrations
{
/// <inheritdoc />
public partial class AddSortTitleToDocumentBase : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "SortTitle",
table: "Magazines",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "SortTitle",
table: "Documents",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "SortTitle",
table: "Books",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SortTitle",
table: "Magazines");
migrationBuilder.DropColumn(
name: "SortTitle",
table: "Documents");
migrationBuilder.DropColumn(
name: "SortTitle",
table: "Books");
}
}
}