Permissions & Authorization for Users #24
Initial Release; Includes Database and MVC refactoring
This commit is contained in:
@@ -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 DBv9 : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(DBv9));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201310010352238_DBv9"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
namespace Disco.Data.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class DBv9 : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
CreateTable(
|
||||
"dbo.AuthorizationRoles",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
Name = c.String(nullable: false, maxLength: 100),
|
||||
SubjectIds = c.String(),
|
||||
ClaimsJson = c.String(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id);
|
||||
|
||||
DropColumn("dbo.Users", "Type");
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
AddColumn("dbo.Users", "Type", c => c.String(maxLength: 8));
|
||||
DropTable("dbo.AuthorizationRoles");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -13,9 +13,9 @@ namespace Disco.Data.Migrations
|
||||
AutomaticMigrationsEnabled = false;
|
||||
}
|
||||
|
||||
protected override void Seed(DiscoDataContext context)
|
||||
protected override void Seed(DiscoDataContext Database)
|
||||
{
|
||||
context.SeedDatabase();
|
||||
Database.SeedDatabase();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,12 +49,12 @@ namespace Disco.Data.Migrations
|
||||
public static void SeedDatabase()
|
||||
{
|
||||
// Seed/Update Database
|
||||
using (DiscoDataContext dbContext = new DiscoDataContext())
|
||||
using (DiscoDataContext database = new DiscoDataContext())
|
||||
{
|
||||
dbContext.SeedDatabase();
|
||||
database.SeedDatabase();
|
||||
try
|
||||
{
|
||||
dbContext.SaveChanges();
|
||||
database.SaveChanges();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user