Browse Source

fix: 修复多语言FlagIcon为非必填

pull/95/head 7.2.2.2
王军 3 years ago
parent
commit
43da750979
  1. 1
      aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Domain/Languages/Aggregates/Language.cs
  2. 2
      aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.EntityFrameworkCore/EntityFrameworkCore/LanguageManagementDbContextModelCreatingExtensions.cs
  3. 1920
      aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20230519052837_UpdateLanguageManagementFlagIconIsNotRequired.Designer.cs
  4. 52
      aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20230519052837_UpdateLanguageManagementFlagIconIsNotRequired.cs
  5. 4
      aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/AbpProDbContextModelSnapshot.cs

1
aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.Domain/Languages/Aggregates/Language.cs

@ -87,7 +87,6 @@ public class Language : FullAuditedAggregateRoot<Guid>, ILanguageInfo
/// </summary>
private void SetFlagIcon(string flagIcon)
{
Guard.Length(flagIcon, nameof(flagIcon), 128, 0);
FlagIcon = flagIcon;
}

2
aspnet-core/modules/LanguageManagement/src/Lion.AbpPro.LanguageManagement.EntityFrameworkCore/EntityFrameworkCore/LanguageManagementDbContextModelCreatingExtensions.cs

@ -13,7 +13,7 @@ namespace Lion.AbpPro.LanguageManagement.EntityFrameworkCore
b.Property(e => e.CultureName).IsRequired().HasMaxLength(128).HasComment("语言名称");
b.Property(e => e.UiCultureName).IsRequired().HasMaxLength(128).HasComment("Ui语言名称");
b.Property(e => e.DisplayName).IsRequired().HasMaxLength(128).HasComment("显示名称");
b.Property(e => e.FlagIcon).IsRequired().HasComment("图标");
b.Property(e => e.FlagIcon).HasMaxLength(128).HasComment("图标");
b.Property<bool>(x => x.IsEnabled).IsRequired();
b.HasIndex(e => e.CultureName).IsUnique();
b.ConfigureByConvention();

1920
aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20230519052837_UpdateLanguageManagementFlagIconIsNotRequired.Designer.cs

File diff suppressed because it is too large

52
aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20230519052837_UpdateLanguageManagementFlagIconIsNotRequired.cs

@ -0,0 +1,52 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Lion.AbpPro.Migrations
{
/// <inheritdoc />
public partial class UpdateLanguageManagementFlagIconIsNotRequired : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "FlagIcon",
table: "AbpLanguages",
type: "varchar(128)",
maxLength: 128,
nullable: true,
comment: "图标",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "图标")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "AbpLanguages",
keyColumn: "FlagIcon",
keyValue: null,
column: "FlagIcon",
value: "");
migrationBuilder.AlterColumn<string>(
name: "FlagIcon",
table: "AbpLanguages",
type: "longtext",
nullable: false,
comment: "图标",
oldClrType: typeof(string),
oldType: "varchar(128)",
oldMaxLength: 128,
oldNullable: true,
oldComment: "图标")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

4
aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/AbpProDbContextModelSnapshot.cs

@ -260,8 +260,8 @@ namespace Lion.AbpPro.Migrations
.HasColumnName("ExtraProperties");
b.Property<string>("FlagIcon")
.IsRequired()
.HasColumnType("longtext")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasComment("图标");
b.Property<bool>("IsDefault")

Loading…
Cancel
Save