refactor(directory): ♻ convert SegmentNumber and Primariness to shorts

This commit is contained in:
Collin M. Barrett 2020-08-27 19:20:25 -05:00
parent 084112a266
commit 3545d7c162
4 changed files with 17 additions and 17 deletions

View file

@ -10,7 +10,7 @@
namespace FilterLists.Directory.Infrastructure.Migrations.Migrations
{
[DbContext(typeof(QueryDbContext))]
[Migration("20200827222216_Initial")]
[Migration("20200828001720_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -355,15 +355,15 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
b1.Property<int>("FilterListId")
.HasColumnType("integer");
b1.Property<int>("Primariness")
b1.Property<short>("Primariness")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(1);
.HasColumnType("smallint")
.HasDefaultValue((short)1);
b1.Property<int>("SegmentNumber")
b1.Property<short>("SegmentNumber")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(1);
.HasColumnType("smallint")
.HasDefaultValue((short)1);
b1.Property<string>("Url")
.IsRequired()

View file

@ -276,8 +276,8 @@ protected override void Up(MigrationBuilder migrationBuilder)
{
Id = table.Column<int>(nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SegmentNumber = table.Column<int>(nullable: false, defaultValue: 1),
Primariness = table.Column<int>(nullable: false, defaultValue: 1),
SegmentNumber = table.Column<short>(nullable: false, defaultValue: (short)1),
Primariness = table.Column<short>(nullable: false, defaultValue: (short)1),
Url = table.Column<string>(nullable: false),
FilterListId = table.Column<int>(nullable: false)
},

View file

@ -353,15 +353,15 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b1.Property<int>("FilterListId")
.HasColumnType("integer");
b1.Property<int>("Primariness")
b1.Property<short>("Primariness")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(1);
.HasColumnType("smallint")
.HasDefaultValue((short)1);
b1.Property<int>("SegmentNumber")
b1.Property<short>("SegmentNumber")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(1);
.HasColumnType("smallint")
.HasDefaultValue((short)1);
b1.Property<string>("Url")
.IsRequired()

View file

@ -4,8 +4,8 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities
{
public class FilterListViewUrl
{
public int SegmentNumber { get; set; }
public int Primariness { get; set; }
public short SegmentNumber { get; set; }
public short Primariness { get; set; }
public Uri Url { get; set; } = null!;
}
}