Skip to content

Commit

Permalink
fix db error
Browse files Browse the repository at this point in the history
  • Loading branch information
Hammerbeck committed May 31, 2024
1 parent a9dfa16 commit 1233f88
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ public class CorrespondenceNotificationDetailsExt : CorrespondenceNotificationOv
/// </summary>
[JsonPropertyName("statusHistory")]
public List<NotificationStatusEventExt> StatusHistory { get; set; }

/// <summary>
/// Created timestamp for the notification
/// </summary>
[JsonPropertyName("created")]
public DateTimeOffset Created { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class CorrespondenceNotificationEntity
[Key]
public Guid Id { get; set; }

public string NotificationTemplate { get; set; }
public required string NotificationTemplate { get; set; }

[StringLength(128, MinimumLength = 0)]
public string? CustomTextToken { get; set; }
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
Expand Up @@ -89,7 +89,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
SendersReference = table.Column<string>(type: "text", nullable: true),
RequestedSendTime = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
CorrespondenceId = table.Column<Guid>(type: "uuid", nullable: false),
Created = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
Created = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, defaultValueSql: "NOW()")
},
constraints: table =>
{
Expand Down Expand Up @@ -129,7 +129,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
Id = table.Column<Guid>(type: "uuid", nullable: false),
Status = table.Column<int>(type: "integer", nullable: false),
StatusText = table.Column<string>(type: "text", nullable: false),
StatusChanged = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
StatusChanged = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, defaultValueSql: "NOW()"),
CorrespondenceId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
Expand Down Expand Up @@ -204,7 +204,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
Id = table.Column<Guid>(type: "uuid", nullable: false),
Status = table.Column<string>(type: "text", nullable: false),
StatusText = table.Column<string>(type: "text", nullable: true),
StatusChanged = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
StatusChanged = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, defaultValueSql: "NOW()"),
NotificationId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
Expand All @@ -225,7 +225,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
Id = table.Column<Guid>(type: "uuid", nullable: false),
Status = table.Column<int>(type: "integer", nullable: false),
StatusText = table.Column<string>(type: "text", nullable: false),
StatusChanged = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
StatusChanged = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, defaultValueSql: "NOW()"),
AttachmentId = table.Column<Guid>(type: "uuid", nullable: false),
CorrespondenceAttachmentEntityId = table.Column<Guid>(type: "uuid", nullable: true)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("integer");
b.Property<DateTimeOffset>("StatusChanged")
.HasColumnType("timestamp with time zone");
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("StatusText")
.IsRequired()
Expand Down Expand Up @@ -252,7 +254,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("uuid");
b.Property<DateTimeOffset>("Created")
.HasColumnType("timestamp with time zone");
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("CustomTextToken")
.HasMaxLength(128)
Expand Down Expand Up @@ -289,7 +293,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("text");
b.Property<DateTimeOffset>("StatusChanged")
.HasColumnType("timestamp with time zone");
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("StatusText")
.HasColumnType("text");
Expand Down Expand Up @@ -338,7 +344,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("integer");
b.Property<DateTimeOffset>("StatusChanged")
.HasColumnType("timestamp with time zone");
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("NOW()");
b.Property<string>("StatusText")
.IsRequired()
Expand Down

0 comments on commit 1233f88

Please sign in to comment.