Create a first migration

This commit is contained in:
2016-09-20 09:08:16 -04:00
parent 3a4fd9f2f2
commit 916c1f0f59
12 changed files with 406 additions and 70 deletions
@@ -175,33 +175,5 @@ namespace InventoryTraker.Web.Controllers
};
return inventoryTypeReportItems;
}
public class InventoryReportItem
{
public Inventory Inventory { get; set; }
public int BeginningQuantity { get; set; }
public int AddedQuantity { get; set; }
public int TotalAvailableQuantity { get; set; }
public int DistributedQuantity { get; set; }
public int AdjustmentQuantity { get; set; }
public int EndingQuantity { get; set; }
}
public class InventoryTypeReport
{
public DateTime Month { get; set; }
public IEnumerable<InventoryTypeReportItem> Items { get; set; }
}
public class InventoryTypeReportItem
{
public InventoryTypeViewModel InventoryType { get; set; }
public int BeginningQuantity { get; set; }
public int AddedQuantity { get; set; }
public int TotalAvailableQuantity { get; set; }
public int DistributedQuantity { get; set; }
public int AdjustmentQuantity { get; set; }
public int EndingQuantity { get; set; }
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace InventoryTraker.Web
BundleConfig.RegisterBundles(BundleTable.Bundles);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
EFConfig.Initialize();
SeedData.Init();
//SeedData.Init();
}
}
}
+13 -2
View File
@@ -332,7 +332,7 @@
<Compile Include="App_Start\EFConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="App_Start\SeedData.cs" />
<Compile Include="Migrations\SeedData.cs" />
<Compile Include="App_Start\Startup.cs" />
<Compile Include="App_Start\StructureMapConfig.cs" />
<Compile Include="Attributes\ActionLogAttribute.cs" />
@@ -362,6 +362,10 @@
<Compile Include="Helpers\UIRatingTag.cs" />
<Compile Include="Identity\ApplicationUserManager.cs" />
<Compile Include="Identity\AspNetIdentityRegistry.cs" />
<Compile Include="Migrations\201609201242047_Initial.cs" />
<Compile Include="Migrations\201609201242047_Initial.Designer.cs">
<DependentUpon>201609201242047_Initial.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Models\DateRangeQuery.cs" />
<Compile Include="Models\DistributionReport.cs" />
@@ -369,6 +373,9 @@
<Compile Include="Models\InventoryAddForm.cs" />
<Compile Include="Models\InventoryQuantityForm.cs" />
<Compile Include="Models\InventoryRemoveForm.cs" />
<Compile Include="Models\InventoryReportItem.cs" />
<Compile Include="Models\InventoryTypeReport.cs" />
<Compile Include="Models\InventoryTypeReportItem.cs" />
<Compile Include="Models\InventoryTypeViewModel.cs" />
<Compile Include="Models\InventoryViewModel.cs" />
<Compile Include="Models\LoginForm.cs" />
@@ -411,7 +418,11 @@
<DependentUpon>Web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<EmbeddedResource Include="Migrations\201609201242047_Initial.resx">
<DependentUpon>201609201242047_Initial.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
@@ -0,0 +1,29 @@
// <auto-generated />
namespace InventoryTraker.Web.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
public sealed partial class Initial : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(Initial));
string IMigrationMetadata.Id
{
get { return "201609201242047_Initial"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,156 @@
namespace InventoryTraker.Web.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class Initial : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.Inventories",
c => new
{
Id = c.Int(nullable: false, identity: true),
ExpirationDate = c.DateTime(nullable: false),
AddedDate = c.DateTime(nullable: false),
Quantity = c.Int(nullable: false),
Memo = c.String(),
InventoryType_Id = c.Int(),
})
.PrimaryKey(t => t.Id)
.ForeignKey("dbo.InventoryTypes", t => t.InventoryType_Id)
.Index(t => t.InventoryType_Id);
CreateTable(
"dbo.InventoryTypes",
c => new
{
Id = c.Int(nullable: false, identity: true),
Identifier = c.String(nullable: false),
Name = c.String(nullable: false),
UnitsPerCase = c.Int(nullable: false),
ContainerType = c.String(nullable: false),
WeightPerCase = c.Double(nullable: false),
PricePerCase = c.Decimal(nullable: false, precision: 18, scale: 2),
})
.PrimaryKey(t => t.Id);
CreateTable(
"dbo.Transactions",
c => new
{
Id = c.Int(nullable: false, identity: true),
TransactionType = c.Int(nullable: false),
AddedQuantity = c.Int(nullable: false),
RemovedQuantity = c.Int(nullable: false),
CurrentQuantity = c.Int(nullable: false),
TransactionDate = c.DateTime(nullable: false),
Memo = c.String(),
Destination = c.String(),
Timestamp = c.DateTime(nullable: false),
Inventory_Id = c.Int(),
})
.PrimaryKey(t => t.Id)
.ForeignKey("dbo.Inventories", t => t.Inventory_Id)
.Index(t => t.Inventory_Id);
CreateTable(
"dbo.AspNetRoles",
c => new
{
Id = c.String(nullable: false, maxLength: 128),
Name = c.String(nullable: false, maxLength: 256),
})
.PrimaryKey(t => t.Id)
.Index(t => t.Name, unique: true, name: "RoleNameIndex");
CreateTable(
"dbo.AspNetUserRoles",
c => new
{
UserId = c.String(nullable: false, maxLength: 128),
RoleId = c.String(nullable: false, maxLength: 128),
})
.PrimaryKey(t => new { t.UserId, t.RoleId })
.ForeignKey("dbo.AspNetRoles", t => t.RoleId, cascadeDelete: true)
.ForeignKey("dbo.AspNetUsers", t => t.UserId, cascadeDelete: true)
.Index(t => t.UserId)
.Index(t => t.RoleId);
CreateTable(
"dbo.AspNetUsers",
c => new
{
Id = c.String(nullable: false, maxLength: 128),
Email = c.String(maxLength: 256),
EmailConfirmed = c.Boolean(nullable: false),
PasswordHash = c.String(),
SecurityStamp = c.String(),
PhoneNumber = c.String(),
PhoneNumberConfirmed = c.Boolean(nullable: false),
TwoFactorEnabled = c.Boolean(nullable: false),
LockoutEndDateUtc = c.DateTime(),
LockoutEnabled = c.Boolean(nullable: false),
AccessFailedCount = c.Int(nullable: false),
UserName = c.String(nullable: false, maxLength: 256),
})
.PrimaryKey(t => t.Id)
.Index(t => t.UserName, unique: true, name: "UserNameIndex");
CreateTable(
"dbo.AspNetUserClaims",
c => new
{
Id = c.Int(nullable: false, identity: true),
UserId = c.String(nullable: false, maxLength: 128),
ClaimType = c.String(),
ClaimValue = c.String(),
})
.PrimaryKey(t => t.Id)
.ForeignKey("dbo.AspNetUsers", t => t.UserId, cascadeDelete: true)
.Index(t => t.UserId);
CreateTable(
"dbo.AspNetUserLogins",
c => new
{
LoginProvider = c.String(nullable: false, maxLength: 128),
ProviderKey = c.String(nullable: false, maxLength: 128),
UserId = c.String(nullable: false, maxLength: 128),
})
.PrimaryKey(t => new { t.LoginProvider, t.ProviderKey, t.UserId })
.ForeignKey("dbo.AspNetUsers", t => t.UserId, cascadeDelete: true)
.Index(t => t.UserId);
}
public override void Down()
{
DropForeignKey("dbo.AspNetUserRoles", "UserId", "dbo.AspNetUsers");
DropForeignKey("dbo.AspNetUserLogins", "UserId", "dbo.AspNetUsers");
DropForeignKey("dbo.AspNetUserClaims", "UserId", "dbo.AspNetUsers");
DropForeignKey("dbo.AspNetUserRoles", "RoleId", "dbo.AspNetRoles");
DropForeignKey("dbo.Transactions", "Inventory_Id", "dbo.Inventories");
DropForeignKey("dbo.Inventories", "InventoryType_Id", "dbo.InventoryTypes");
DropIndex("dbo.AspNetUserLogins", new[] { "UserId" });
DropIndex("dbo.AspNetUserClaims", new[] { "UserId" });
DropIndex("dbo.AspNetUsers", "UserNameIndex");
DropIndex("dbo.AspNetUserRoles", new[] { "RoleId" });
DropIndex("dbo.AspNetUserRoles", new[] { "UserId" });
DropIndex("dbo.AspNetRoles", "RoleNameIndex");
DropIndex("dbo.Transactions", new[] { "Inventory_Id" });
DropIndex("dbo.Inventories", new[] { "InventoryType_Id" });
DropTable("dbo.AspNetUserLogins");
DropTable("dbo.AspNetUserClaims");
DropTable("dbo.AspNetUsers");
DropTable("dbo.AspNetUserRoles");
DropTable("dbo.AspNetRoles");
DropTable("dbo.Transactions");
DropTable("dbo.InventoryTypes");
DropTable("dbo.Inventories");
}
}
}
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Target" xml:space="preserve">
<value>H4sIAAAAAAAEAO1dW2/kthV+L9D/IOipLZwZX7qLrWEncMZ2a3R96Y436ZvBkThjYXWZSJRjI8gv60N/Uv9CSV15FylpLhsEAYKxSH7nwkPy8JA8+7///Pfsu9codF5gmgVJfO4eTQ5dB8Ze4gfx6tzN0fKbD+533/7xD2dXfvTq/FDXOyH1cMs4O3efEVqfTqeZ9wwjkE2iwEuTLFmiiZdEU+An0+PDw79Nj46mEEO4GMtxzj7lMQoiWPyB/5wlsQfXKAfhbeLDMKu+45J5gercgQhma+DBc/cmfoExStK3xxR8genkR7iYXAIEXOciDADmZw7DpeuAOE4QQJjb088ZnKM0iVfzNf4Awse3NcT1liDMYCXFaVvdVKDDYyLQtG1YQ3l5hpLIEvDopNLQlG/eS89uo0Gswyusa/RGpC70SKnQdXhqp7MwJTXlep4lKZw0BQeOpM5BYyTYlsh/B84sD1GewvMY5igF4YHzkC/CwPsnfHtMvsD4PM7DkGYYs4zLmA/400OarGGK3j7BZS2G7zpTtt2Ub9g0o9rU8qGTY9e5w8TBIoSNPVC6mGPR4N9hDFOAoP8AEIJpTDBgoVGBOkfr6nUdpAUStk9Y0yW/H7HtS0jr4S58H/qjIP0rB5UAelXoUW5hlNQIeHzhCcN1bsHrRxiv0DMuBq+ucx28Qr/+UqF+jgM8v+BGKM1FInfgJVgVSuN7rrE1TNF1PsGwqJU9B+tyzLeG+cTVvU6T6FMS0iBslad5kqceUWyir/cI0hVE5kzjcRFnwCsYlfJMVXiihmXLsbRCw0fNr7xWLRXN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M4/TvqRuah/Qa1/Xbzxj0zaTNGmu+5pGGLZkXKa5mXaV0USS80CfEWFjKU22bT+q23cW0ax9yr60DwZUZbdQGNCm0y1t24BUV+320YC68yvtg/3sahnbhfUYL187z6Ekvrrn+7K6Fibcc9GmSCqvA527/oIcsJX7P13OEyWZcpOmJlVdgdSQU+Sh4SkyrrpAjymVUdOliFFmFiqtXhSOKZZRK7NlyxNIqIi1w0xJsK2iJqrOXMETLucZgVj5WU/ATqrKedGKVdXRk1VkYNHRrtY9Le2qjp62IgfKDrNH0UNPkilAnLOku2tZ+667jQYq2FhSKEvW1WEAqrUuR9veZXuS5quRJXHrWOklKMp0cDvM7iSk9zEWk5l2FG93RhJ0jGRO/QVl5jjFg5KRBB2eu6m/mGOarUWuJvHONXby8picYpZ/XcIsWLUQ5Cp5DD3GvWvq3MTLpPYyOY7qKsIdKAR87PtdpChY4jkKF5MDzOKfVKiS7F9FC+jfxPc5WucIiwyjRchMhMRb1dEvElKxPJ/drwtfaQwRMJsBOfi9j7/Pg7D9hwSuJQcOCgjiBlfHhaQvETk2XL01SHdJbAhUqa/x3h9htA4xWHYfz8EL7MMbNr+PcAW8t/Z4SQXS3RGs2s8uA7BKQZRVGG17/Ce2YT96/fb/ZW0K6VaEAAA=</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>
@@ -9,12 +9,12 @@ namespace InventoryTraker.Web.Migrations
{
AutomaticMigrationsEnabled = true;
// TODO false
AutomaticMigrationDataLossAllowed = true;
AutomaticMigrationDataLossAllowed = false;
}
protected override void Seed(AppDbContext context)
{
}
}
}
}
}
@@ -10,52 +10,55 @@ using InventoryTraker.Web.Utilities;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
namespace InventoryTraker.Web
namespace InventoryTraker.Web.Migrations
{
public static class SeedData
{
public static void Init()
{
using (var context = new AppDbContext())
Init(context);
}
public static void Init(AppDbContext context)
{
if (!context.Users.Any())
{
if (!context.Users.Any())
var manager = new ApplicationUserManager(new UserStore<User>(context));
manager.Create(new User
{
var manager = new ApplicationUserManager(new UserStore<User>(context));
manager.Create(new User
{
Email = "james.kolpack@gmail.com",
UserName = "James Kolpack",
}, "hgBdFiJTK");
Email = "james.kolpack@gmail.com",
UserName = "James Kolpack",
}, "hgBdFiJTK");
manager.Create(new User
{
Email = "bbanegas@ethra.org",
UserName = "Brandi Banegas",
}, "3v9qxe");
manager.Create(new User
{
Email = "ccecil@ethra.org",
UserName = "Cyndie Cecil",
}, "95kdsxa");
manager.Create(new User
{
Email = "knorton@ethra.org",
UserName = "Kay Norton",
}, "rt9pmz1");
}
if (!context.Inventories.Any())
manager.Create(new User
{
AddInventoryTypes(context);
Email = "bbanegas@ethra.org",
UserName = "Brandi Banegas",
}, "3v9qxe");
context.SaveChanges();
manager.Create(new User
{
Email = "ccecil@ethra.org",
UserName = "Cyndie Cecil",
}, "95kdsxa");
//AddInventory(context);
manager.Create(new User
{
Email = "knorton@ethra.org",
UserName = "Kay Norton",
}, "rt9pmz1");
}
//context.SaveChanges();
}
if (!context.Inventories.Any())
{
AddInventoryTypes(context);
context.SaveChanges();
AddInventory(context);
context.SaveChanges();
}
}
@@ -0,0 +1,15 @@
using InventoryTraker.Web.Core;
namespace InventoryTraker.Web.Models
{
public class InventoryReportItem
{
public Inventory Inventory { get; set; }
public int BeginningQuantity { get; set; }
public int AddedQuantity { get; set; }
public int TotalAvailableQuantity { get; set; }
public int DistributedQuantity { get; set; }
public int AdjustmentQuantity { get; set; }
public int EndingQuantity { get; set; }
}
}
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
namespace InventoryTraker.Web.Models
{
public class InventoryTypeReport
{
public DateTime Month { get; set; }
public IEnumerable<InventoryTypeReportItem> Items { get; set; }
}
}
@@ -0,0 +1,13 @@
namespace InventoryTraker.Web.Models
{
public class InventoryTypeReportItem
{
public InventoryTypeViewModel InventoryType { get; set; }
public int BeginningQuantity { get; set; }
public int AddedQuantity { get; set; }
public int TotalAvailableQuantity { get; set; }
public int DistributedQuantity { get; set; }
public int AdjustmentQuantity { get; set; }
public int EndingQuantity { get; set; }
}
}