Files
CartriX/CartriX.Api/Migrations/AppDbContextModelSnapshot.cs
T

210 lines
6.9 KiB
C#

// <auto-generated />
using CartriX.Api;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace CartriX.Api.Migrations
{
[DbContext(typeof(AppDbContext))]
partial class AppDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.6");
modelBuilder.Entity("CartriX.Api.Models.Cartridge", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Capacity")
.HasColumnType("INTEGER");
b.Property<int?>("InPrinterId")
.HasColumnType("INTEGER");
b.Property<string>("Model")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("StatusId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("InPrinterId");
b.HasIndex("StatusId");
b.ToTable("Cartridges");
});
modelBuilder.Entity("CartriX.Api.Models.Printer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("IpAddress")
.HasColumnType("TEXT");
b.Property<int>("PrinterConnectionTypeId")
.HasColumnType("INTEGER");
b.Property<string>("PrinterName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("PrinterUsedPagesOID")
.HasColumnType("TEXT");
b.Property<int>("StatusId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("PrinterConnectionTypeId");
b.HasIndex("StatusId");
b.ToTable("Printers");
});
modelBuilder.Entity("CartriX.Api.Models.PrinterConnectionType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("PrinterConnectionType");
b.HasData(
new
{
Id = 1,
Name = "Network"
},
new
{
Id = 2,
Name = "USB"
});
});
modelBuilder.Entity("CartriX.Api.Models.StatusCartridge", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("StatusCartridges");
});
modelBuilder.Entity("CartriX.Api.Models.StatusPrinter", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("StatusPrinters");
});
modelBuilder.Entity("CartridgePrinter", b =>
{
b.Property<int>("SupportCartridgeModelsId")
.HasColumnType("INTEGER");
b.Property<int>("SupportPrinterModelsId")
.HasColumnType("INTEGER");
b.HasKey("SupportCartridgeModelsId", "SupportPrinterModelsId");
b.HasIndex("SupportPrinterModelsId");
b.ToTable("CartridgeCapabilityPrinters", (string)null);
});
modelBuilder.Entity("CartriX.Api.Models.Cartridge", b =>
{
b.HasOne("CartriX.Api.Models.Printer", "InPrinter")
.WithMany("CartridgesHave")
.HasForeignKey("InPrinterId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("CartriX.Api.Models.StatusCartridge", "Status")
.WithMany()
.HasForeignKey("StatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("InPrinter");
b.Navigation("Status");
});
modelBuilder.Entity("CartriX.Api.Models.Printer", b =>
{
b.HasOne("CartriX.Api.Models.PrinterConnectionType", "PrinterConnectionType")
.WithMany()
.HasForeignKey("PrinterConnectionTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Models.StatusPrinter", "Status")
.WithMany()
.HasForeignKey("StatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("PrinterConnectionType");
b.Navigation("Status");
});
modelBuilder.Entity("CartridgePrinter", b =>
{
b.HasOne("CartriX.Api.Models.Cartridge", null)
.WithMany()
.HasForeignKey("SupportCartridgeModelsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Models.Printer", null)
.WithMany()
.HasForeignKey("SupportPrinterModelsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("CartriX.Api.Models.Printer", b =>
{
b.Navigation("CartridgesHave");
});
#pragma warning restore 612, 618
}
}
}