Feature: Device Batch Attachments
allows for attachments to be uploaded and associated with Device Batches
This commit is contained in:
@@ -163,6 +163,10 @@
|
||||
<Compile Include="Migrations\201611100557315_DBv19.Designer.cs">
|
||||
<DependentUpon>201611100557315_DBv19.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\202011260525547_DBv20.cs" />
|
||||
<Compile Include="Migrations\202011260525547_DBv20.Designer.cs">
|
||||
<DependentUpon>202011260525547_DBv20.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\Configuration.cs" />
|
||||
<Compile Include="Migrations\DiscoDataMigrator.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@@ -235,6 +239,9 @@
|
||||
<EmbeddedResource Include="Migrations\201611100557315_DBv19.resx">
|
||||
<DependentUpon>201611100557315_DBv19.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\202011260525547_DBv20.resx">
|
||||
<DependentUpon>202011260525547_DBv20.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
@@ -246,6 +253,11 @@
|
||||
<None Include="Resources\EmptyLogo.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_StartDate="2000/1/1" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// <auto-generated />
|
||||
namespace Disco.Data.Migrations
|
||||
{
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
public sealed partial class DBv20 : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(DBv20));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "202011260525547_DBv20"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -34,6 +34,7 @@ namespace Disco.Data.Repository
|
||||
public virtual DbSet<DeviceModel> DeviceModels { get; set; }
|
||||
public virtual DbSet<DeviceProfile> DeviceProfiles { get; set; }
|
||||
public virtual DbSet<DeviceBatch> DeviceBatches { get; set; }
|
||||
public virtual DbSet<DeviceBatchAttachment> DeviceBatchAttachments { get; set; }
|
||||
public virtual DbSet<DeviceComponent> DeviceComponents { get; set; }
|
||||
public virtual DbSet<DeviceAttachment> DeviceAttachments { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user