Fleshed out entity classes and created command to create student

This commit is contained in:
2019-04-24 23:57:55 +00:00
parent a30e9a5b1c
commit acba25cc0b
13 changed files with 129 additions and 27 deletions

View File

@@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace BrightGlimmer.Data.Migrations
{
[DbContext(typeof(BgContext))]
[Migration("20190424174147_CreateDatabase")]
[Migration("20190424233105_CreateDatabase")]
partial class CreateDatabase
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -157,6 +157,9 @@ namespace BrightGlimmer.Data.Migrations
b.HasIndex("AddressId");
b.HasIndex("StudentNumber")
.IsUnique();
b.ToTable("Students");
});

View File

@@ -147,6 +147,12 @@ namespace BrightGlimmer.Data.Migrations
name: "IX_Students_AddressId",
table: "Students",
column: "AddressId");
migrationBuilder.CreateIndex(
name: "IX_Students_StudentNumber",
table: "Students",
column: "StudentNumber",
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)

View File

@@ -155,6 +155,9 @@ namespace BrightGlimmer.Data.Migrations
b.HasIndex("AddressId");
b.HasIndex("StudentNumber")
.IsUnique();
b.ToTable("Students");
});