Updated field size changes to database

This commit is contained in:
2026-08-16 10:21:55 +02:00
parent 9540ebef9d
commit a9f4b45d20
3 changed files with 1730 additions and 8 deletions
@@ -0,0 +1,98 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PostFundManagement.Infrastructure.Database.Migrations
{
/// <inheritdoc />
public partial class StandardisedFieldSizes : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Code",
table: "Instruments",
type: "character varying(100)",
maxLength: 100,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "Category",
table: "Beneficiaries",
type: "character varying(100)",
maxLength: 100,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "EntityName",
table: "AuditLogs",
type: "character varying(256)",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(128)",
oldMaxLength: 128);
migrationBuilder.AlterColumn<string>(
name: "Action",
table: "AuditLogs",
type: "character varying(100)",
maxLength: 100,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(64)",
oldMaxLength: 64);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Code",
table: "Instruments",
type: "character varying(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(100)",
oldMaxLength: 100);
migrationBuilder.AlterColumn<string>(
name: "Category",
table: "Beneficiaries",
type: "character varying(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(100)",
oldMaxLength: 100);
migrationBuilder.AlterColumn<string>(
name: "EntityName",
table: "AuditLogs",
type: "character varying(128)",
maxLength: 128,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(256)",
oldMaxLength: 256);
migrationBuilder.AlterColumn<string>(
name: "Action",
table: "AuditLogs",
type: "character varying(64)",
maxLength: 64,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(100)",
oldMaxLength: 100);
}
}
}
@@ -32,8 +32,8 @@ namespace PostFundManagement.Infrastructure.Database.Migrations
b.Property<string>("Action")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.PrimitiveCollection<string>("Changes")
.HasColumnType("jsonb");
@@ -43,8 +43,8 @@ namespace PostFundManagement.Infrastructure.Database.Migrations
b.Property<string>("EntityName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<Guid>("PerformedBy")
.HasColumnType("uuid");
@@ -131,8 +131,8 @@ namespace PostFundManagement.Infrastructure.Database.Migrations
b.Property<string>("Category")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
@@ -548,8 +548,8 @@ namespace PostFundManagement.Infrastructure.Database.Migrations
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()