// using System; 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.8"); modelBuilder.Entity("CartriX.Api.Entities.AddressOID", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("OIDAddress") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("AddressOIDs"); b.HasData( new { Id = 1, OIDAddress = "1.3.6.1.2.1.43.10.2.1.4.1.1" }, new { Id = 2, OIDAddress = "1.3.6.1.4.1.40093.6.4.1" }); }); 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("ModelId") .HasColumnType("INTEGER"); b.Property("StatusId") .HasColumnType("INTEGER"); b.Property("Volume") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("InstalledInPrinterId") .IsUnique(); b.HasIndex("ModelId"); b.HasIndex("StatusId"); b.ToTable("Cartridges"); }); 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.CartridgeModelFamily", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("CartridgeModelFamily"); }); modelBuilder.Entity("CartriX.Api.Entities.CartridgeStatus", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("CartridgeStatuses"); b.HasData( new { Id = 1, Name = "Установлен" }, new { Id = 2, Name = "На складе" }, new { Id = 3, Name = "На заправке" }, new { Id = 4, Name = "Очередь на заправку" }, new { Id = 5, Name = "В ремонте" }); }); modelBuilder.Entity("CartriX.Api.Entities.CauseFoReplace", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Description") .IsRequired() .HasColumnType("TEXT"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("CausesFoReplace"); b.HasData( new { Id = 1, Description = "Картридж истратил свой тоннер и требует заправки.", Name = "Закончился" }, new { Id = 2, Description = "Картридж работает не корректно, оставляет полосы на распечатанной бумаге. \nТребуется диагностика.", Name = "Полосит" }, new { Id = 3, Description = "Картридж работает не корректно, тоннер наноситься на бумагу бледно. \nТребуется диагностика.", Name = "Бледнит" }); }); 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.Manufacturer", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.Property("picturePath") .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("Manufacturers"); b.HasData( new { Id = 1, Name = "Неизвестен" }); }); modelBuilder.Entity("CartriX.Api.Entities.Printer", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("CountPrintedAllTime") .HasColumnType("INTEGER"); b.Property("IpAddressOrHostname") .HasColumnType("TEXT"); b.Property("LocationId") .HasColumnType("INTEGER"); b.Property("ModelId") .HasColumnType("INTEGER"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.Property("OidForQueryCountPrintedAllTime") .HasColumnType("TEXT"); b.Property("PrintTypeId") .HasColumnType("INTEGER"); b.Property("PrinterConnetctionTypeId") .HasColumnType("INTEGER"); b.Property("StatusId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("LocationId"); b.HasIndex("ModelId"); b.HasIndex("Name") .IsUnique(); b.HasIndex("PrintTypeId"); b.HasIndex("PrinterConnetctionTypeId"); b.HasIndex("StatusId"); b.ToTable("Printers"); }); modelBuilder.Entity("CartriX.Api.Entities.PrinterConnetctionType", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("PrinterConnetctionTypes"); b.HasData( new { Id = 1, Name = "Сетевой" }, new { Id = 2, Name = "USB" }); }); 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.Property("SupportedArticleId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("ManufacturerId"); b.HasIndex("SupportedArticleId") .IsUnique(); b.ToTable("PrinterModels"); }); modelBuilder.Entity("CartriX.Api.Entities.PrinterPrintType", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("PrinterPrintTypes"); b.HasData( new { Id = 1, Name = "Лазерный" }, new { Id = 2, Name = "Струйный" }); }); modelBuilder.Entity("CartriX.Api.Entities.PrinterStatus", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("PrinterStatuses"); b.HasData( new { Id = 1, Name = "Активный" }, new { Id = 2, Name = "Недоступен" }, new { Id = 3, Name = "В ремонте" }); }); modelBuilder.Entity("CartriX.Api.Entities.RecordPrintedPages", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("CounntPrinted") .HasColumnType("INTEGER"); b.Property("Date") .HasColumnType("TEXT"); b.Property("PrinterId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("PrinterId"); b.ToTable("RecordPrintedPages"); }); modelBuilder.Entity("CartriX.Api.Entities.RequestToReplaceCartridge", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Applocant") .IsRequired() .HasColumnType("TEXT"); b.Property("CartridgeInfo") .IsRequired() .HasColumnType("TEXT"); b.Property("CauseId") .HasColumnType("INTEGER"); b.Property("CountCartridgePrinted") .HasColumnType("INTEGER"); b.Property("DateAnswerRequest") .HasColumnType("TEXT"); b.Property("DateCreateRequest") .HasColumnType("TEXT"); b.Property("Executor") .HasColumnType("TEXT"); b.Property("LocationName") .IsRequired() .HasColumnType("TEXT"); b.Property("PrinterInfo") .IsRequired() .HasColumnType("TEXT"); b.Property("ReplacedCartridgeId") .HasColumnType("INTEGER"); b.Property("SignatureBase64Data") .HasColumnType("TEXT"); b.HasKey("Id"); b.HasIndex("CauseId"); b.ToTable("RequestsToReplaceCartridge"); }); modelBuilder.Entity("CartridgeModelCartridgeModelFamily", b => { b.Property("CartridgeModelsId") .HasColumnType("INTEGER"); b.Property("SupportedFamiliesId") .HasColumnType("INTEGER"); b.HasKey("CartridgeModelsId", "SupportedFamiliesId"); b.HasIndex("SupportedFamiliesId"); b.ToTable("CartridgeModelCartridgeModelFamily"); }); modelBuilder.Entity("CartriX.Api.Entities.Cartridge", b => { b.HasOne("CartriX.Api.Entities.Printer", "InstalledInPrinter") .WithOne("InstalledCartridge") .HasForeignKey("CartriX.Api.Entities.Cartridge", "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") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Manufacturer"); }); modelBuilder.Entity("CartriX.Api.Entities.Printer", b => { 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.PrinterPrintType", "PrintType") .WithMany() .HasForeignKey("PrintTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("CartriX.Api.Entities.PrinterConnetctionType", "PrinterConnetctionType") .WithMany() .HasForeignKey("PrinterConnetctionTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("CartriX.Api.Entities.PrinterStatus", "Status") .WithMany() .HasForeignKey("StatusId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Location"); b.Navigation("Model"); b.Navigation("PrintType"); b.Navigation("PrinterConnetctionType"); b.Navigation("Status"); }); modelBuilder.Entity("CartriX.Api.Entities.PrinterModel", b => { b.HasOne("CartriX.Api.Entities.Manufacturer", "Manufacturer") .WithMany() .HasForeignKey("ManufacturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("CartriX.Api.Entities.CartridgeModelFamily", "SupportedArticle") .WithOne("SupportedPrinterModel") .HasForeignKey("CartriX.Api.Entities.PrinterModel", "SupportedArticleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Manufacturer"); b.Navigation("SupportedArticle"); }); modelBuilder.Entity("CartriX.Api.Entities.RecordPrintedPages", b => { b.HasOne("CartriX.Api.Entities.Printer", "Printer") .WithMany() .HasForeignKey("PrinterId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Printer"); }); modelBuilder.Entity("CartriX.Api.Entities.RequestToReplaceCartridge", b => { b.HasOne("CartriX.Api.Entities.CauseFoReplace", "Cause") .WithMany() .HasForeignKey("CauseId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Cause"); }); modelBuilder.Entity("CartridgeModelCartridgeModelFamily", b => { b.HasOne("CartriX.Api.Entities.CartridgeModel", null) .WithMany() .HasForeignKey("CartridgeModelsId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("CartriX.Api.Entities.CartridgeModelFamily", null) .WithMany() .HasForeignKey("SupportedFamiliesId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("CartriX.Api.Entities.CartridgeModelFamily", b => { b.Navigation("SupportedPrinterModel") .IsRequired(); }); modelBuilder.Entity("CartriX.Api.Entities.Location", b => { b.Navigation("Printers"); }); modelBuilder.Entity("CartriX.Api.Entities.Printer", b => { b.Navigation("InstalledCartridge") .IsRequired(); }); #pragma warning restore 612, 618 } } }