mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
refactor(directory): ♻ make Language.Iso6391 fixed length to 2 chars
This commit is contained in:
parent
b58a5d9d9b
commit
152cdc2c57
4 changed files with 13 additions and 6 deletions
|
|
@ -10,7 +10,7 @@
|
|||
namespace FilterLists.Directory.Infrastructure.Migrations.Migrations
|
||||
{
|
||||
[DbContext(typeof(QueryDbContext))]
|
||||
[Migration("20200827115451_Initial")]
|
||||
[Migration("20200827222216_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
|
|
@ -93,7 +93,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Iso6391")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("character varying(2)");
|
||||
|
||||
b.HasKey("FilterListId", "Iso6391");
|
||||
|
||||
|
|
@ -165,7 +165,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|||
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Language", b =>
|
||||
{
|
||||
b.Property<string>("Iso6391")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("character(2)")
|
||||
.IsFixedLength(true)
|
||||
.HasMaxLength(2);
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
|
|
@ -11,7 +11,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
|
|||
name: "Languages",
|
||||
columns: table => new
|
||||
{
|
||||
Iso6391 = table.Column<string>(nullable: false),
|
||||
Iso6391 = table.Column<string>(fixedLength: true, maxLength: 2, nullable: false),
|
||||
Name = table.Column<string>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
|
|
@ -91,7 +91,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
|
|||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Iso6391")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("character varying(2)");
|
||||
|
||||
b.HasKey("FilterListId", "Iso6391");
|
||||
|
||||
|
|
@ -163,7 +163,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
|
|||
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Language", b =>
|
||||
{
|
||||
b.Property<string>("Iso6391")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("character(2)")
|
||||
.IsFixedLength(true)
|
||||
.HasMaxLength(2);
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ public virtual void Configure(EntityTypeBuilder<Language> builder)
|
|||
{
|
||||
_ = builder ?? throw new ArgumentNullException(nameof(builder));
|
||||
builder.HasKey(l => l.Iso6391);
|
||||
builder.Property(l => l.Iso6391)
|
||||
.IsFixedLength()
|
||||
.HasMaxLength(2);
|
||||
builder.HasDataJsonFile<Language>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue