Feature #26: User Flags

Flags can be associated with Users. Includes minor updates to Job Queues
and improved visibility of user information.
This commit is contained in:
Gary Sharp
2014-06-10 17:16:24 +10:00
parent b64ac3b16f
commit 4c3a68da30
104 changed files with 8112 additions and 1623 deletions
+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 DBv14 : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(DBv14));
string IMigrationMetadata.Id
{
get { return "201406090652547_DBv14"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,61 @@
namespace Disco.Data.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class DBv14 : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.UserFlagAssignments",
c => new
{
Id = c.Int(nullable: false, identity: true),
UserFlagId = c.Int(nullable: false),
UserId = c.String(nullable: false, maxLength: 50),
AddedDate = c.DateTime(nullable: false),
AddedUserId = c.String(nullable: false, maxLength: 50),
RemovedDate = c.DateTime(),
RemovedUserId = c.String(maxLength: 50),
Comments = c.String(),
})
.PrimaryKey(t => t.Id)
.ForeignKey("dbo.UserFlags", t => t.UserFlagId)
.ForeignKey("dbo.Users", t => t.UserId)
.ForeignKey("dbo.Users", t => t.AddedUserId)
.ForeignKey("dbo.Users", t => t.RemovedUserId)
.Index(t => t.UserFlagId)
.Index(t => t.UserId)
.Index(t => t.AddedUserId)
.Index(t => t.RemovedUserId);
CreateTable(
"dbo.UserFlags",
c => new
{
Id = c.Int(nullable: false, identity: true),
Name = c.String(nullable: false, maxLength: 100),
Description = c.String(maxLength: 500),
Icon = c.String(nullable: false, maxLength: 25),
IconColour = c.String(nullable: false, maxLength: 10),
})
.PrimaryKey(t => t.Id);
}
public override void Down()
{
DropIndex("dbo.UserFlagAssignments", new[] { "RemovedUserId" });
DropIndex("dbo.UserFlagAssignments", new[] { "AddedUserId" });
DropIndex("dbo.UserFlagAssignments", new[] { "UserId" });
DropIndex("dbo.UserFlagAssignments", new[] { "UserFlagId" });
DropForeignKey("dbo.UserFlagAssignments", "RemovedUserId", "dbo.Users");
DropForeignKey("dbo.UserFlagAssignments", "AddedUserId", "dbo.Users");
DropForeignKey("dbo.UserFlagAssignments", "UserId", "dbo.Users");
DropForeignKey("dbo.UserFlagAssignments", "UserFlagId", "dbo.UserFlags");
DropTable("dbo.UserFlags");
DropTable("dbo.UserFlagAssignments");
}
}
}
File diff suppressed because one or more lines are too long