Link device with reports in server database.

This commit is contained in:
2018-12-22 20:46:51 +00:00
parent e7e3b6c29f
commit bbb6cff8fe
7 changed files with 193 additions and 6 deletions

View File

@@ -1795,6 +1795,9 @@
<e p="201812220029427_AddStatistics.Designer.cs" t="Include" />
<e p="201812220029427_AddStatistics.cs" t="Include" />
<e p="201812220029427_AddStatistics.resx" t="Include" />
<e p="201812221606592_LinkDeviceStatsToReport.Designer.cs" t="Include" />
<e p="201812221606592_LinkDeviceStatsToReport.cs" t="Include" />
<e p="201812221606592_LinkDeviceStatsToReport.resx" t="Include" />
<e p="Configuration.cs" t="Include" />
</e>
<e p="Models" t="Include">

View File

@@ -205,6 +205,10 @@
<Compile Include="Migrations\201812220029427_AddStatistics.Designer.cs">
<DependentUpon>201812220029427_AddStatistics.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201812221606592_LinkDeviceStatsToReport.cs" />
<Compile Include="Migrations\201812221606592_LinkDeviceStatsToReport.Designer.cs">
<DependentUpon>201812221606592_LinkDeviceStatsToReport.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Models\Command.cs" />
<Compile Include="Models\Context.cs" />
@@ -291,6 +295,9 @@
<EmbeddedResource Include="Migrations\201812220029427_AddStatistics.resx">
<DependentUpon>201812220029427_AddStatistics.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201812221606592_LinkDeviceStatsToReport.resx">
<DependentUpon>201812221606592_LinkDeviceStatsToReport.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>

View File

@@ -0,0 +1,29 @@
// <auto-generated />
namespace DiscImageChef.Server.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class LinkDeviceStatsToReport : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(LinkDeviceStatsToReport));
string IMigrationMetadata.Id
{
get { return "201812221606592_LinkDeviceStatsToReport"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

View File

@@ -0,0 +1,21 @@
using System.Data.Entity.Migrations;
namespace DiscImageChef.Server.Migrations
{
public partial class LinkDeviceStatsToReport : DbMigration
{
public override void Up()
{
AddColumn("dbo.DeviceStats", "Report_Id", c => c.Int());
CreateIndex("dbo.DeviceStats", "Report_Id");
AddForeignKey("dbo.DeviceStats", "Report_Id", "dbo.Devices", "Id");
}
public override void Down()
{
DropForeignKey("dbo.DeviceStats", "Report_Id", "dbo.Devices");
DropIndex("dbo.DeviceStats", new[] {"Report_Id"});
DropColumn("dbo.DeviceStats", "Report_Id");
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -7,7 +7,7 @@ namespace DiscImageChef.Server.Migrations
{
public Configuration()
{
AutomaticMigrationsEnabled = true;
AutomaticMigrationsEnabled = false;
}
protected override void Seed(DicServerContext context)

View File

@@ -10,5 +10,6 @@ namespace DiscImageChef.Server.Models
public string Model { get; set; }
public string Revision { get; set; }
public string Bus { get; set; }
public virtual Device Report { get; set; }
}
}