Add expiry date to cases

This commit is contained in:
jvyden 2022-06-10 19:07:15 -04:00
commit 65bcf3ae8e
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
3 changed files with 35 additions and 0 deletions

View file

@ -17,6 +17,8 @@ public class ModerationCase
public DateTime CaseCreated { get; set; } public DateTime CaseCreated { get; set; }
public DateTime? CaseExpires { get; set; }
public int CaseCreatorId { get; set; } public int CaseCreatorId { get; set; }
[ForeignKey(nameof(CaseCreatorId))] [ForeignKey(nameof(CaseCreatorId))]

View file

@ -0,0 +1,30 @@
using System;
using LBPUnion.ProjectLighthouse;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ProjectLighthouse.Migrations
{
[DbContext(typeof(Database))]
[Migration("20220610230647_AddExpirationDateToCases")]
public class AddExpirationDateToCases : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "CaseExpires",
table: "Cases",
type: "datetime(6)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CaseExpires",
table: "Cases");
}
}
}

View file

@ -48,6 +48,9 @@ namespace ProjectLighthouse.Migrations
.IsRequired() .IsRequired()
.HasColumnType("longtext"); .HasColumnType("longtext");
b.Property<DateTime?>("CaseExpires")
.HasColumnType("datetime(6)");
b.Property<int>("CaseType") b.Property<int>("CaseType")
.HasColumnType("int"); .HasColumnType("int");