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