Files
CartriX/CartriX.Api/Migrations/20260517060659_Init3.Designer.cs
T
2026-05-17 23:54:25 +09:00

535 lines
17 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// <auto-generated />
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("20260517060659_Init3")]
partial class Init3
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.7");
modelBuilder.Entity("ArticleCartridgeModel", b =>
{
b.Property<int>("articlesid")
.HasColumnType("INTEGER");
b.Property<int>("cartridgeModelid")
.HasColumnType("INTEGER");
b.HasKey("articlesid", "cartridgeModelid");
b.HasIndex("cartridgeModelid");
b.ToTable("ArticleCartridgeModel");
});
modelBuilder.Entity("ArticlePrinterModel", b =>
{
b.Property<int>("articlesid")
.HasColumnType("INTEGER");
b.Property<int>("printerModelid")
.HasColumnType("INTEGER");
b.HasKey("articlesid", "printerModelid");
b.HasIndex("printerModelid");
b.ToTable("ArticlePrinterModel");
});
modelBuilder.Entity("CartriX.Api.Entities.Article", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("id");
b.ToTable("Articles");
});
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>("maxCountPrint")
.HasColumnType("INTEGER");
b.Property<int>("modelid")
.HasColumnType("INTEGER");
b.Property<int>("statusId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(2);
b.HasKey("id");
b.HasIndex("installedInPrinterid");
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.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 = "Installed"
},
new
{
id = 2,
name = "InStock"
},
new
{
id = 3,
name = "Refilling"
},
new
{
id = 4,
name = "InlineRefilling"
},
new
{
id = 5,
name = "UnderRepair"
});
});
modelBuilder.Entity("CartriX.Api.Entities.ConnetctionType", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("id");
b.ToTable("СonnetctionTypes");
b.HasData(
new
{
id = 1,
name = "Network"
},
new
{
id = 2,
name = "USB"
});
});
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.HasKey("id");
b.ToTable("Manufacturers");
});
modelBuilder.Entity("CartriX.Api.Entities.PrintType", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("id");
b.ToTable("PrintTypes");
b.HasData(
new
{
id = 1,
name = "Laser"
},
new
{
id = 2,
name = "Inkjet"
});
});
modelBuilder.Entity("CartriX.Api.Entities.Printer", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("connetctionTypeid")
.HasColumnType("INTEGER");
b.Property<int>("countPrintedAllTime")
.HasColumnType("INTEGER");
b.Property<string>("hostname")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("ipAddress")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("locationid")
.HasColumnType("INTEGER");
b.Property<int?>("manufacturerid")
.HasColumnType("INTEGER");
b.Property<int>("modelid")
.HasColumnType("INTEGER");
b.Property<string>("name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("oidForQueryCountPrintedAllTime")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.HasDefaultValue("1.3.6.1.2.1.43.10.2.1.4.1.1");
b.Property<int>("printTypeId")
.HasColumnType("INTEGER");
b.Property<int>("statusId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(1);
b.HasKey("id");
b.HasIndex("connetctionTypeid");
b.HasIndex("locationid");
b.HasIndex("manufacturerid");
b.HasIndex("modelid");
b.HasIndex("printTypeId");
b.HasIndex("statusId");
b.ToTable("Printers");
});
modelBuilder.Entity("CartriX.Api.Entities.PrinterCounterRecord", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("countPrinted")
.HasColumnType("INTEGER");
b.Property<DateTime>("date")
.HasColumnType("TEXT");
b.Property<int>("printerid")
.HasColumnType("INTEGER");
b.HasKey("id");
b.HasIndex("printerid");
b.ToTable("PrinterCounterRecord");
});
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.HasKey("id");
b.HasIndex("manufacturerid");
b.ToTable("PrinterModels");
});
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 = "Active"
},
new
{
id = 2,
name = "Unavailable"
},
new
{
id = 3,
name = "UnderRepair"
});
});
modelBuilder.Entity("ArticleCartridgeModel", b =>
{
b.HasOne("CartriX.Api.Entities.Article", null)
.WithMany()
.HasForeignKey("articlesid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Entities.CartridgeModel", null)
.WithMany()
.HasForeignKey("cartridgeModelid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("ArticlePrinterModel", b =>
{
b.HasOne("CartriX.Api.Entities.Article", null)
.WithMany()
.HasForeignKey("articlesid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Entities.PrinterModel", null)
.WithMany()
.HasForeignKey("printerModelid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
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.Printer", b =>
{
b.HasOne("CartriX.Api.Entities.ConnetctionType", "connetctionType")
.WithMany()
.HasForeignKey("connetctionTypeid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Entities.Location", "location")
.WithMany()
.HasForeignKey("locationid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Entities.Manufacturer", "manufacturer")
.WithMany()
.HasForeignKey("manufacturerid");
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.HasOne("CartriX.Api.Entities.PrinterStatus", "status")
.WithMany()
.HasForeignKey("statusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("connetctionType");
b.Navigation("location");
b.Navigation("manufacturer");
b.Navigation("model");
b.Navigation("printType");
b.Navigation("status");
});
modelBuilder.Entity("CartriX.Api.Entities.PrinterCounterRecord", b =>
{
b.HasOne("CartriX.Api.Entities.Printer", "printer")
.WithMany()
.HasForeignKey("printerid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("printer");
});
modelBuilder.Entity("CartriX.Api.Entities.PrinterModel", b =>
{
b.HasOne("CartriX.Api.Entities.Manufacturer", "manufacturer")
.WithMany()
.HasForeignKey("manufacturerid");
b.Navigation("manufacturer");
});
modelBuilder.Entity("CartriX.Api.Entities.Printer", b =>
{
b.Navigation("installedCartridges");
});
#pragma warning restore 612, 618
}
}
}