Feature: Job Queues

Also UI style, theme and element changes
This commit is contained in:
Gary Sharp
2014-02-03 14:50:08 +11:00
parent bdb3e1e6b4
commit 3f63281dc4
212 changed files with 17334 additions and 5441 deletions
+7
View File
@@ -126,6 +126,10 @@
<Compile Include="Migrations\201310282325491_DBv11.Designer.cs">
<DependentUpon>201310282325491_DBv11.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201401270857381_DBv12.cs" />
<Compile Include="Migrations\201401270857381_DBv12.Designer.cs">
<DependentUpon>201401270857381_DBv12.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Migrations\DiscoDataMigrator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -174,6 +178,9 @@
<EmbeddedResource Include="Migrations\201310282325491_DBv11.resx">
<DependentUpon>201310282325491_DBv11.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201401270857381_DBv12.resx">
<DependentUpon>201401270857381_DBv12.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
+27
View File
@@ -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 DBv12 : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(DBv12));
string IMigrationMetadata.Id
{
get { return "201401270857381_DBv12"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,86 @@
namespace Disco.Data.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class DBv12 : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.JobQueueJobs",
c => new
{
Id = c.Int(nullable: false, identity: true),
JobQueueId = c.Int(nullable: false),
JobId = c.Int(nullable: false),
AddedDate = c.DateTime(nullable: false),
AddedUserId = c.String(nullable: false, maxLength: 50),
AddedComment = c.String(),
RemovedDate = c.DateTime(),
RemovedUserId = c.String(maxLength: 50),
RemovedComment = c.String(),
SLAExpiresDate = c.DateTime(),
Priority = c.Byte(nullable: false),
})
.PrimaryKey(t => t.Id)
.ForeignKey("dbo.JobQueues", t => t.JobQueueId)
.ForeignKey("dbo.Jobs", t => t.JobId)
.ForeignKey("dbo.Users", t => t.AddedUserId)
.ForeignKey("dbo.Users", t => t.RemovedUserId)
.Index(t => t.JobQueueId)
.Index(t => t.JobId)
.Index(t => t.AddedUserId)
.Index(t => t.RemovedUserId);
CreateTable(
"dbo.JobQueues",
c => new
{
Id = c.Int(nullable: false, identity: true),
Name = c.String(nullable: false, maxLength: 100),
Description = c.String(nullable: false, maxLength: 500),
Icon = c.String(nullable: false, maxLength: 25),
IconColour = c.String(nullable: false, maxLength: 10),
DefaultSLAExpiry = c.Int(),
Priority = c.Byte(nullable: false),
SubjectIds = c.String(),
})
.PrimaryKey(t => t.Id);
CreateTable(
"dbo.JobQueues_JobSubTypes",
c => new
{
JobQueue_Id = c.Int(nullable: false),
JobSubType_Id = c.String(nullable: false, maxLength: 20),
JobSubType_JobTypeId = c.String(nullable: false, maxLength: 5),
})
.PrimaryKey(t => new { t.JobQueue_Id, t.JobSubType_Id, t.JobSubType_JobTypeId })
.ForeignKey("dbo.JobQueues", t => t.JobQueue_Id, cascadeDelete: true)
.ForeignKey("dbo.JobSubTypes", t => new { t.JobSubType_Id, t.JobSubType_JobTypeId }, cascadeDelete: true)
.Index(t => t.JobQueue_Id)
.Index(t => new { t.JobSubType_Id, t.JobSubType_JobTypeId });
}
public override void Down()
{
DropIndex("dbo.JobQueues_JobSubTypes", new[] { "JobSubType_Id", "JobSubType_JobTypeId" });
DropIndex("dbo.JobQueues_JobSubTypes", new[] { "JobQueue_Id" });
DropIndex("dbo.JobQueueJobs", new[] { "RemovedUserId" });
DropIndex("dbo.JobQueueJobs", new[] { "AddedUserId" });
DropIndex("dbo.JobQueueJobs", new[] { "JobId" });
DropIndex("dbo.JobQueueJobs", new[] { "JobQueueId" });
DropForeignKey("dbo.JobQueues_JobSubTypes", new[] { "JobSubType_Id", "JobSubType_JobTypeId" }, "dbo.JobSubTypes");
DropForeignKey("dbo.JobQueues_JobSubTypes", "JobQueue_Id", "dbo.JobQueues");
DropForeignKey("dbo.JobQueueJobs", "RemovedUserId", "dbo.Users");
DropForeignKey("dbo.JobQueueJobs", "AddedUserId", "dbo.Users");
DropForeignKey("dbo.JobQueueJobs", "JobId", "dbo.Jobs");
DropForeignKey("dbo.JobQueueJobs", "JobQueueId", "dbo.JobQueues");
DropTable("dbo.JobQueues_JobSubTypes");
DropTable("dbo.JobQueues");
DropTable("dbo.JobQueueJobs");
}
}
}
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.1128.1503")]
[assembly: AssemblyFileVersion("1.2.1128.1503")]
[assembly: AssemblyVersion("1.2.1229.1537")]
[assembly: AssemblyFileVersion("1.2.1229.1537")]
@@ -48,6 +48,9 @@ namespace Disco.Data.Repository
public virtual DbSet<JobMetaNonWarranty> JobMetaNonWarranties { get; set; }
public virtual DbSet<JobMetaInsurance> JobMetaInsurances { get; set; }
public virtual DbSet<JobQueue> JobQueues { get; set; }
public virtual DbSet<JobQueueJob> JobQueueJobs { get; set; }
public Configuration.SystemConfiguration DiscoConfiguration
{
get
@@ -62,6 +65,7 @@ namespace Disco.Data.Repository
modelBuilder.Entity<DeviceComponent>().HasMany(m => m.JobSubTypes).WithMany(m => m.DeviceComponents).Map(m => m.ToTable("DeviceComponents_JobSubTypes"));
modelBuilder.Entity<DocumentTemplate>().HasMany(m => m.JobSubTypes).WithMany(m => m.AttachmentTypes).Map(m => m.ToTable("DocumentTemplates_JobSubTypes"));
modelBuilder.Entity<JobQueue>().HasMany(m => m.JobSubTypes).WithMany(m => m.JobQueues).Map(m => m.ToTable("JobQueues_JobSubTypes"));
modelBuilder.Entity<Job>().HasMany(m => m.JobSubTypes).WithMany(m => m.Jobs).Map(m => m.ToTable("Jobs_JobSubTypes"));
modelBuilder.Entity<User>().HasMany(m => m.Jobs).WithOptional(m => m.User);