feat: update entity configurations to specify column types for cities, states, and countries

This commit is contained in:
masoodafar-web
2025-12-18 03:49:47 +03:30
parent ead0cf4235
commit c7211fb9a7
5 changed files with 3576 additions and 9 deletions
@@ -20,7 +20,9 @@ public class CityConfiguration : IEntityTypeConfiguration<City>
builder.Property(c => c.Name)
.IsRequired()
.HasMaxLength(500);
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
;
builder.Property(c => c.Latitude)
.IsRequired()
@@ -33,6 +35,8 @@ public class CityConfiguration : IEntityTypeConfiguration<City>
builder.Property(c => c.Native)
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasDefaultValue("");
builder.Property(c => c.IsDeleted)
@@ -20,7 +20,9 @@ public class CountryConfiguration : IEntityTypeConfiguration<Country>
builder.Property(c => c.Name)
.IsRequired()
.HasMaxLength(500);
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
;
builder.Property(c => c.Iso3)
.IsRequired()
@@ -40,7 +42,9 @@ public class CountryConfiguration : IEntityTypeConfiguration<Country>
builder.Property(c => c.Capital)
.IsRequired()
.HasMaxLength(500);
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
;
builder.Property(c => c.Currency)
.IsRequired()
@@ -48,7 +52,9 @@ public class CountryConfiguration : IEntityTypeConfiguration<Country>
builder.Property(c => c.CurrencyName)
.IsRequired()
.HasMaxLength(100);
.HasMaxLength(100)
.HasColumnType("nvarchar(100)")
;
builder.Property(c => c.CurrencySymbol)
.IsRequired()
@@ -60,15 +66,21 @@ public class CountryConfiguration : IEntityTypeConfiguration<Country>
builder.Property(c => c.Native)
.IsRequired()
.HasMaxLength(500);
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
;
builder.Property(c => c.Region)
.IsRequired()
.HasMaxLength(100);
.HasMaxLength(100)
.HasColumnType("nvarchar(100)")
;
builder.Property(c => c.Subregion)
.IsRequired()
.HasMaxLength(100);
.HasMaxLength(100)
.HasColumnType("nvarchar(100)")
;
builder.Property(c => c.Latitude)
.IsRequired()
@@ -20,7 +20,9 @@ public class StateConfiguration : IEntityTypeConfiguration<State>
builder.Property(s => s.Name)
.IsRequired()
.HasMaxLength(500);
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
;
builder.Property(s => s.StateCode)
.IsRequired()
@@ -36,11 +38,15 @@ public class StateConfiguration : IEntityTypeConfiguration<State>
builder.Property(s => s.Type)
.IsRequired()
.HasMaxLength(100);
.HasMaxLength(100)
.HasColumnType("nvarchar(100)")
;
builder.Property(s => s.Native)
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasDefaultValue("");
builder.Property(s => s.IsDeleted)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CMSMicroservice.Infrastructure.Persistence.Migrations
{
/// <inheritdoc />
public partial class u14 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}