Feature: Device Batch Attachments

allows for attachments to be uploaded and associated with Device Batches
This commit is contained in:
Gary Sharp
2020-11-29 16:41:20 +11:00
parent e531ffe2b7
commit 28e5901929
26 changed files with 2153 additions and 320 deletions
@@ -0,0 +1,39 @@
namespace Disco.Data.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class DBv20 : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.DeviceBatchAttachments",
c => new
{
Id = c.Int(nullable: false, identity: true),
DeviceBatchId = c.Int(nullable: false),
TechUserId = c.String(nullable: false, maxLength: 50),
Filename = c.String(nullable: false, maxLength: 500),
MimeType = c.String(nullable: false, maxLength: 500),
Timestamp = c.DateTime(nullable: false),
Comments = c.String(nullable: false, maxLength: 500),
})
.PrimaryKey(t => t.Id)
.ForeignKey("dbo.DeviceBatches", t => t.DeviceBatchId)
.ForeignKey("dbo.Users", t => t.TechUserId)
.Index(t => t.DeviceBatchId)
.Index(t => t.TechUserId);
}
public override void Down()
{
DropIndex("dbo.DeviceBatchAttachments", new[] { "TechUserId" });
DropIndex("dbo.DeviceBatchAttachments", new[] { "DeviceBatchId" });
DropForeignKey("dbo.DeviceBatchAttachments", "TechUserId", "dbo.Users");
DropForeignKey("dbo.DeviceBatchAttachments", "DeviceBatchId", "dbo.DeviceBatches");
DropTable("dbo.DeviceBatchAttachments");
}
}
}