mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 20:40:55 +00:00
486 lines
16 KiB
C#
486 lines
16 KiB
C#
// <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("20260515105316_Init1")]
|
|
partial class Init1
|
|
{
|
|
/// <inheritdoc />
|
|
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<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")
|
|
.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<int>("id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("name")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("id");
|
|
|
|
b.ToTable("cartridgeArticles");
|
|
});
|
|
|
|
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")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("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<int>("id")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("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<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.LogPrinter", 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("LogPrinters");
|
|
});
|
|
|
|
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")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("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<int>("id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("connetctionTypeid")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("countPrintedAllTime")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("hostname")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("ipAddress")
|
|
.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")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT")
|
|
.HasDefaultValue("1.3.6.1.2.1.43.10.2.1.4.1.1");
|
|
|
|
b.Property<int>("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<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("CartridgeArticleCartridgeModel", b =>
|
|
{
|
|
b.Property<int>("Articlesid")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("CartridgeModelsid")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.HasKey("Articlesid", "CartridgeModelsid");
|
|
|
|
b.HasIndex("CartridgeModelsid");
|
|
|
|
b.ToTable("PrintersModelsCartridgeArticles", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("CartridgeArticlePrinterModel", b =>
|
|
{
|
|
b.Property<int>("PrinterModelsid")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("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
|
|
}
|
|
}
|
|
}
|