mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 12:30:55 +00:00
627 lines
21 KiB
C#
627 lines
21 KiB
C#
// <auto-generated />
|
||
using System;
|
||
using CartriX.Api;
|
||
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("20260607052602_Init1")]
|
||
partial class Init1
|
||
{
|
||
/// <inheritdoc />
|
||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||
{
|
||
#pragma warning disable 612, 618
|
||
modelBuilder.HasAnnotation("ProductVersion", "10.0.8");
|
||
|
||
modelBuilder.Entity("CartriX.Api.Entities.Cartridge", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("CountPrinted")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<DateOnly?>("DateLastFilling")
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<int?>("InstalledInPrinterId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("ModelId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("StatusId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("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<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("ManufacturerId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("Name")
|
||
.IsRequired()
|
||
.HasColumnType("TEXT");
|
||
|
||
b.HasKey("Id");
|
||
|
||
b.HasIndex("ManufacturerId");
|
||
|
||
b.ToTable("CartridgeModels");
|
||
});
|
||
|
||
modelBuilder.Entity("CartriX.Api.Entities.CartridgeModelFamily", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("Name")
|
||
.IsRequired()
|
||
.HasColumnType("TEXT");
|
||
|
||
b.HasKey("Id");
|
||
|
||
b.ToTable("CartridgeModelFamily");
|
||
});
|
||
|
||
modelBuilder.Entity("CartriX.Api.Entities.CartridgeStatus", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("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<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("Description")
|
||
.IsRequired()
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<string>("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<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("Name")
|
||
.IsRequired()
|
||
.HasColumnType("TEXT");
|
||
|
||
b.HasKey("Id");
|
||
|
||
b.HasIndex("Name")
|
||
.IsUnique();
|
||
|
||
b.ToTable("Locations");
|
||
});
|
||
|
||
modelBuilder.Entity("CartriX.Api.Entities.Manufacturer", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("Name")
|
||
.IsRequired()
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<string>("picturePath")
|
||
.HasColumnType("TEXT");
|
||
|
||
b.HasKey("Id");
|
||
|
||
b.ToTable("Manufacturers");
|
||
|
||
b.HasData(
|
||
new
|
||
{
|
||
Id = 1,
|
||
Name = "Неизвестен"
|
||
});
|
||
});
|
||
|
||
modelBuilder.Entity("CartriX.Api.Entities.Printer", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("CountPrintedAllTime")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("IpAddressOrHostname")
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<int>("LocationId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("ModelId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("Name")
|
||
.IsRequired()
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<string>("OidForQueryCountPrintedAllTime")
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<int>("PrintTypeId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("PrinterConnetctionTypeId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("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<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("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<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("ManufacturerId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("Name")
|
||
.IsRequired()
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<string>("PicturePath")
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<int>("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<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("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<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("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<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("CounntPrinted")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<DateOnly>("Date")
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<int>("PrinterId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.HasKey("Id");
|
||
|
||
b.HasIndex("PrinterId");
|
||
|
||
b.ToTable("RecordPrintedPages");
|
||
});
|
||
|
||
modelBuilder.Entity("CartriX.Api.Entities.RequestToReplaceCartridge", b =>
|
||
{
|
||
b.Property<int>("Id")
|
||
.ValueGeneratedOnAdd()
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("Applocant")
|
||
.IsRequired()
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<string>("CartridgeInfo")
|
||
.IsRequired()
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<int>("CauseId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int?>("CountCartridgePrinted")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<DateOnly?>("DateAnswerRequest")
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<DateOnly>("DateCreateRequest")
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<string>("Executor")
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<string>("LocationName")
|
||
.IsRequired()
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<string>("PrinterInfo")
|
||
.IsRequired()
|
||
.HasColumnType("TEXT");
|
||
|
||
b.Property<int>("ReplacedCartridgeId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<string>("SignatureBase64Data")
|
||
.HasColumnType("TEXT");
|
||
|
||
b.HasKey("Id");
|
||
|
||
b.HasIndex("CauseId");
|
||
|
||
b.ToTable("RequestsToReplaceCartridge");
|
||
});
|
||
|
||
modelBuilder.Entity("CartridgeModelCartridgeModelFamily", b =>
|
||
{
|
||
b.Property<int>("CartridgeModelsId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("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
|
||
}
|
||
}
|
||
}
|