// using System; using CartriX.Api.Classes; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable namespace CartriX.Api.Migrations { [DbContext(typeof(AppDbContext))] [Migration("20260515105316_Init1")] partial class Init1 { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder.HasAnnotation("ProductVersion", "10.0.7"); modelBuilder.Entity("CartriX.Api.Entities.Cartridge", b => { b.Property("id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("countPrinted") .HasColumnType("INTEGER"); b.Property("dateLastFilling") .HasColumnType("TEXT"); b.Property("installedInPrinterid") .HasColumnType("INTEGER"); b.Property("maxCountPrint") .HasColumnType("INTEGER"); b.Property("modelid") .HasColumnType("INTEGER"); b.Property("statusid") .HasColumnType("INTEGER"); b.HasKey("id"); b.HasIndex("installedInPrinterid"); b.HasIndex("modelid"); b.HasIndex("statusid"); b.ToTable("Cartridges"); }); modelBuilder.Entity("CartriX.Api.Entities.CartridgeArticle", b => { b.Property("id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("id"); b.ToTable("cartridgeArticles"); }); modelBuilder.Entity("CartriX.Api.Entities.CartridgeModel", b => { b.Property("id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("manufacturerid") .HasColumnType("INTEGER"); b.Property("name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("id"); b.HasIndex("manufacturerid"); b.ToTable("CartridgeModels"); }); modelBuilder.Entity("CartriX.Api.Entities.CartridgeStatus", b => { b.Property("id") .HasColumnType("INTEGER"); b.Property("name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("id"); b.ToTable((string)null); b.ToView("CartridgeStatuses", (string)null); b.HasData( new { id = 1, name = "Installed" }, new { id = 2, name = "InStock" }, new { id = 3, name = "WriteOff" }, new { id = 4, name = "Refilling" }, new { id = 5, name = "InlineRefilling" }, new { id = 6, name = "UnderRepair" }); }); modelBuilder.Entity("CartriX.Api.Entities.ConnetctionType", b => { b.Property("id") .HasColumnType("INTEGER"); b.Property("name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("id"); b.ToTable((string)null); b.ToView("ConnetctionTypes", (string)null); b.HasData( new { id = 1, name = "Network" }, new { id = 2, name = "USB" }); }); modelBuilder.Entity("CartriX.Api.Entities.Location", b => { b.Property("id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("id"); b.HasIndex("name") .IsUnique(); b.ToTable("Locations"); }); modelBuilder.Entity("CartriX.Api.Entities.LogPrinter", b => { b.Property("id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("countPrinted") .HasColumnType("INTEGER"); b.Property("date") .HasColumnType("TEXT"); b.Property("printerid") .HasColumnType("INTEGER"); b.HasKey("id"); b.HasIndex("printerid"); b.ToTable("LogPrinters"); }); modelBuilder.Entity("CartriX.Api.Entities.Manufacturer", b => { b.Property("id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("id"); b.ToTable("Manufacturers"); }); modelBuilder.Entity("CartriX.Api.Entities.PrintType", b => { b.Property("id") .HasColumnType("INTEGER"); b.Property("name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("id"); b.ToTable((string)null); b.ToView("PrintTypes", (string)null); b.HasData( new { id = 1, name = "Laser" }, new { id = 2, name = "Inkjet" }); }); modelBuilder.Entity("CartriX.Api.Entities.Printer", b => { b.Property("id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("connetctionTypeid") .HasColumnType("INTEGER"); b.Property("countPrintedAllTime") .HasColumnType("INTEGER"); b.Property("hostname") .HasColumnType("TEXT"); b.Property("ipAddress") .HasColumnType("TEXT"); b.Property("locationid") .HasColumnType("INTEGER"); b.Property("modelid") .HasColumnType("INTEGER"); b.Property("name") .IsRequired() .HasColumnType("TEXT"); b.Property("oidForQueryCountPrintedAllTime") .ValueGeneratedOnAdd() .HasColumnType("TEXT") .HasDefaultValue("1.3.6.1.2.1.43.10.2.1.4.1.1"); b.Property("printTypeId") .HasColumnType("INTEGER"); b.HasKey("id"); b.HasIndex("connetctionTypeid"); b.HasIndex("locationid"); b.HasIndex("modelid"); b.HasIndex("printTypeId"); b.ToTable("Printers"); }); modelBuilder.Entity("CartriX.Api.Entities.PrinterModel", b => { b.Property("id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("manufacturerid") .HasColumnType("INTEGER"); b.Property("name") .IsRequired() .HasColumnType("TEXT"); b.Property("picturePath") .HasColumnType("TEXT"); b.HasKey("id"); b.HasIndex("manufacturerid"); b.ToTable("PrinterModels"); }); modelBuilder.Entity("CartridgeArticleCartridgeModel", b => { b.Property("Articlesid") .HasColumnType("INTEGER"); b.Property("CartridgeModelsid") .HasColumnType("INTEGER"); b.HasKey("Articlesid", "CartridgeModelsid"); b.HasIndex("CartridgeModelsid"); b.ToTable("PrintersModelsCartridgeArticles", (string)null); }); modelBuilder.Entity("CartridgeArticlePrinterModel", b => { b.Property("PrinterModelsid") .HasColumnType("INTEGER"); b.Property("SupportedArticlesid") .HasColumnType("INTEGER"); b.HasKey("PrinterModelsid", "SupportedArticlesid"); b.HasIndex("SupportedArticlesid"); b.ToTable("CartridgeArticlePrinterModel"); }); modelBuilder.Entity("CartriX.Api.Entities.Cartridge", b => { b.HasOne("CartriX.Api.Entities.Printer", "installedInPrinter") .WithMany("installedCartridges") .HasForeignKey("installedInPrinterid"); b.HasOne("CartriX.Api.Entities.CartridgeModel", "model") .WithMany() .HasForeignKey("modelid") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("CartriX.Api.Entities.CartridgeStatus", "status") .WithMany() .HasForeignKey("statusid") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("installedInPrinter"); b.Navigation("model"); b.Navigation("status"); }); modelBuilder.Entity("CartriX.Api.Entities.CartridgeModel", b => { b.HasOne("CartriX.Api.Entities.Manufacturer", "manufacturer") .WithMany() .HasForeignKey("manufacturerid"); b.Navigation("manufacturer"); }); modelBuilder.Entity("CartriX.Api.Entities.LogPrinter", b => { b.HasOne("CartriX.Api.Entities.Printer", "printer") .WithMany() .HasForeignKey("printerid") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("printer"); }); modelBuilder.Entity("CartriX.Api.Entities.Printer", b => { b.HasOne("CartriX.Api.Entities.ConnetctionType", "connetctionType") .WithMany() .HasForeignKey("connetctionTypeid") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("CartriX.Api.Entities.Location", "location") .WithMany("printers") .HasForeignKey("locationid") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("CartriX.Api.Entities.PrinterModel", "model") .WithMany() .HasForeignKey("modelid") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("CartriX.Api.Entities.PrintType", "printType") .WithMany() .HasForeignKey("printTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("connetctionType"); b.Navigation("location"); b.Navigation("model"); b.Navigation("printType"); }); modelBuilder.Entity("CartriX.Api.Entities.PrinterModel", b => { b.HasOne("CartriX.Api.Entities.Manufacturer", "manufacturer") .WithMany() .HasForeignKey("manufacturerid"); b.Navigation("manufacturer"); }); modelBuilder.Entity("CartridgeArticleCartridgeModel", b => { b.HasOne("CartriX.Api.Entities.CartridgeArticle", null) .WithMany() .HasForeignKey("Articlesid") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("CartriX.Api.Entities.CartridgeModel", null) .WithMany() .HasForeignKey("CartridgeModelsid") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("CartridgeArticlePrinterModel", b => { b.HasOne("CartriX.Api.Entities.PrinterModel", null) .WithMany() .HasForeignKey("PrinterModelsid") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("CartriX.Api.Entities.CartridgeArticle", null) .WithMany() .HasForeignKey("SupportedArticlesid") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("CartriX.Api.Entities.Location", b => { b.Navigation("printers"); }); modelBuilder.Entity("CartriX.Api.Entities.Printer", b => { b.Navigation("installedCartridges"); }); #pragma warning restore 612, 618 } } }