0b357e1e13
Removed strongly typed inventory objects Added EAV inventory types Added EAV object handling philosophy Added controllers Added EF Core migration integration Reviewed-on: #1
180 lines
6.2 KiB
C#
180 lines
6.2 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using WyvernInventory.Infrastructure.Data;
|
|
|
|
#nullable disable
|
|
|
|
namespace WyvernInventory.Infrastructure.Migrations
|
|
{
|
|
[DbContext(typeof(DBContext))]
|
|
partial class DBContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "10.0.7")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("WyvernInventory.Core.Models.InventoryAttributeDefinition", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int?>("DataType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Name")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int?>("TypeId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TypeId");
|
|
|
|
b.ToTable("InventoryAttributeDefinitions");
|
|
});
|
|
|
|
modelBuilder.Entity("WyvernInventory.Core.Models.InventoryAttributeValue", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("AttributeDefinitionId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool?>("BoolValue")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime?>("DateTimeValue")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<decimal?>("DecimalValue")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int?>("IntValue")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("ItemId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("StringValue")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AttributeDefinitionId");
|
|
|
|
b.HasIndex("ItemId", "AttributeDefinitionId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("InventoryAttributeValues");
|
|
});
|
|
|
|
modelBuilder.Entity("WyvernInventory.Core.Models.InventoryItem", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("TypeId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TypeId");
|
|
|
|
b.ToTable("InventoryItems");
|
|
});
|
|
|
|
modelBuilder.Entity("WyvernInventory.Core.Models.InventoryType", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("InventoryTypes");
|
|
});
|
|
|
|
modelBuilder.Entity("WyvernInventory.Core.Models.InventoryAttributeDefinition", b =>
|
|
{
|
|
b.HasOne("WyvernInventory.Core.Models.InventoryType", "Type")
|
|
.WithMany("AttributeDefinitions")
|
|
.HasForeignKey("TypeId")
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
|
|
b.Navigation("Type");
|
|
});
|
|
|
|
modelBuilder.Entity("WyvernInventory.Core.Models.InventoryAttributeValue", b =>
|
|
{
|
|
b.HasOne("WyvernInventory.Core.Models.InventoryAttributeDefinition", "AttributeDefinition")
|
|
.WithMany()
|
|
.HasForeignKey("AttributeDefinitionId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.HasOne("WyvernInventory.Core.Models.InventoryItem", "Item")
|
|
.WithMany("AttributeValues")
|
|
.HasForeignKey("ItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("AttributeDefinition");
|
|
|
|
b.Navigation("Item");
|
|
});
|
|
|
|
modelBuilder.Entity("WyvernInventory.Core.Models.InventoryItem", b =>
|
|
{
|
|
b.HasOne("WyvernInventory.Core.Models.InventoryType", "Type")
|
|
.WithMany()
|
|
.HasForeignKey("TypeId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Type");
|
|
});
|
|
|
|
modelBuilder.Entity("WyvernInventory.Core.Models.InventoryItem", b =>
|
|
{
|
|
b.Navigation("AttributeValues");
|
|
});
|
|
|
|
modelBuilder.Entity("WyvernInventory.Core.Models.InventoryType", b =>
|
|
{
|
|
b.Navigation("AttributeDefinitions");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|