feat: update entity configurations to specify column types for cities, states, and countries
This commit is contained in:
+5
-1
@@ -20,7 +20,9 @@ public class CityConfiguration : IEntityTypeConfiguration<City>
|
|||||||
|
|
||||||
builder.Property(c => c.Name)
|
builder.Property(c => c.Name)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(500);
|
.HasMaxLength(500)
|
||||||
|
.HasColumnType("nvarchar(500)")
|
||||||
|
;
|
||||||
|
|
||||||
builder.Property(c => c.Latitude)
|
builder.Property(c => c.Latitude)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
@@ -33,6 +35,8 @@ public class CityConfiguration : IEntityTypeConfiguration<City>
|
|||||||
builder.Property(c => c.Native)
|
builder.Property(c => c.Native)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(500)
|
.HasMaxLength(500)
|
||||||
|
.HasColumnType("nvarchar(500)")
|
||||||
|
|
||||||
.HasDefaultValue("");
|
.HasDefaultValue("");
|
||||||
|
|
||||||
builder.Property(c => c.IsDeleted)
|
builder.Property(c => c.IsDeleted)
|
||||||
|
|||||||
+18
-6
@@ -20,7 +20,9 @@ public class CountryConfiguration : IEntityTypeConfiguration<Country>
|
|||||||
|
|
||||||
builder.Property(c => c.Name)
|
builder.Property(c => c.Name)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(500);
|
.HasMaxLength(500)
|
||||||
|
.HasColumnType("nvarchar(500)")
|
||||||
|
;
|
||||||
|
|
||||||
builder.Property(c => c.Iso3)
|
builder.Property(c => c.Iso3)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
@@ -40,7 +42,9 @@ public class CountryConfiguration : IEntityTypeConfiguration<Country>
|
|||||||
|
|
||||||
builder.Property(c => c.Capital)
|
builder.Property(c => c.Capital)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(500);
|
.HasMaxLength(500)
|
||||||
|
.HasColumnType("nvarchar(500)")
|
||||||
|
;
|
||||||
|
|
||||||
builder.Property(c => c.Currency)
|
builder.Property(c => c.Currency)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
@@ -48,7 +52,9 @@ public class CountryConfiguration : IEntityTypeConfiguration<Country>
|
|||||||
|
|
||||||
builder.Property(c => c.CurrencyName)
|
builder.Property(c => c.CurrencyName)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(100);
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)")
|
||||||
|
;
|
||||||
|
|
||||||
builder.Property(c => c.CurrencySymbol)
|
builder.Property(c => c.CurrencySymbol)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
@@ -60,15 +66,21 @@ public class CountryConfiguration : IEntityTypeConfiguration<Country>
|
|||||||
|
|
||||||
builder.Property(c => c.Native)
|
builder.Property(c => c.Native)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(500);
|
.HasMaxLength(500)
|
||||||
|
.HasColumnType("nvarchar(500)")
|
||||||
|
;
|
||||||
|
|
||||||
builder.Property(c => c.Region)
|
builder.Property(c => c.Region)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(100);
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)")
|
||||||
|
;
|
||||||
|
|
||||||
builder.Property(c => c.Subregion)
|
builder.Property(c => c.Subregion)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(100);
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)")
|
||||||
|
;
|
||||||
|
|
||||||
builder.Property(c => c.Latitude)
|
builder.Property(c => c.Latitude)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
|
|||||||
+8
-2
@@ -20,7 +20,9 @@ public class StateConfiguration : IEntityTypeConfiguration<State>
|
|||||||
|
|
||||||
builder.Property(s => s.Name)
|
builder.Property(s => s.Name)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(500);
|
.HasMaxLength(500)
|
||||||
|
.HasColumnType("nvarchar(500)")
|
||||||
|
;
|
||||||
|
|
||||||
builder.Property(s => s.StateCode)
|
builder.Property(s => s.StateCode)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
@@ -36,11 +38,15 @@ public class StateConfiguration : IEntityTypeConfiguration<State>
|
|||||||
|
|
||||||
builder.Property(s => s.Type)
|
builder.Property(s => s.Type)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(100);
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("nvarchar(100)")
|
||||||
|
;
|
||||||
|
|
||||||
builder.Property(s => s.Native)
|
builder.Property(s => s.Native)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(500)
|
.HasMaxLength(500)
|
||||||
|
.HasColumnType("nvarchar(500)")
|
||||||
|
|
||||||
.HasDefaultValue("");
|
.HasDefaultValue("");
|
||||||
|
|
||||||
builder.Property(s => s.IsDeleted)
|
builder.Property(s => s.IsDeleted)
|
||||||
|
|||||||
+3523
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)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user