Skip to content

Commit

Permalink
Remove MessageIndex columns (#32)
Browse files Browse the repository at this point in the history
* Navigation property `UserSignature` at `DispenserDTO` can be `null`

* Remove `MessageIndex` columns

* - revert `DispenserContextModelSnapshot` changes
  • Loading branch information
ArdenHide authored Dec 12, 2024
1 parent 356b2b0 commit d7952a2
Show file tree
Hide file tree
Showing 5 changed files with 276 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/DispenserProvider.DataBase/Models/BuilderDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public class BuilderDTO
[Column(TypeName = "datetime2(0)")]
public DateTime? FinishTime { get; set; }

public int MessageIndex { get; set; }

public long TransactionDetailId { get; set; }
public virtual TransactionDetailDTO TransactionDetail { get; set; } = null!;
}
2 changes: 0 additions & 2 deletions src/DispenserProvider.DataBase/Models/DispenserDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public class DispenserDTO
[Column(TypeName = "datetime2(0)")]
public DateTime RefundFinishTime { get; set; }

public int MessageIndex { get; set; }

[Column(TypeName = "nvarchar(132)")]
public string? Signature { get; set; }
public virtual SignatureDTO? UserSignature { get; set; } = null!;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DispenserProvider.DataBase.Migrations
{
/// <inheritdoc />
public partial class RemoveMessageIndexColumns : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "MessageIndex",
table: "Dispenser");

migrationBuilder.DropColumn(
name: "MessageIndex",
table: "Builders");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "MessageIndex",
table: "Dispenser",
type: "int",
nullable: false,
defaultValue: 0);

migrationBuilder.AddColumn<int>(
name: "MessageIndex",
table: "Builders",
type: "int",
nullable: false,
defaultValue: 0);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<DateTime?>("FinishTime")
.HasColumnType("datetime2(0)");

b.Property<int>("MessageIndex")
.HasColumnType("int");

b.Property<string>("ProviderAddress")
.IsRequired()
.HasColumnType("nvarchar(42)");
Expand Down Expand Up @@ -68,9 +65,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("DeletionLogSignature")
.HasColumnType("nvarchar(132)");

b.Property<int>("MessageIndex")
.HasColumnType("int");

b.Property<long?>("RefundDetailId")
.HasColumnType("bigint");

Expand Down

0 comments on commit d7952a2

Please sign in to comment.