Files
CartriX/CartriX.Api/Migrations/20260421110217_Init1.Designer.cs
T
2026-04-21 23:18:12 +09:00

270 lines
8.7 KiB
C#

// <auto-generated />
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("20260421110217_Init1")]
partial class Init1
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.6");
modelBuilder.Entity("CartriX.Api.Models.Cartridge", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Capacity")
.HasColumnType("INTEGER");
b.Property<int?>("InPrinterId")
.HasColumnType("INTEGER");
b.Property<int>("ModelId")
.HasColumnType("INTEGER");
b.Property<int>("StatusId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("InPrinterId");
b.HasIndex("ModelId");
b.HasIndex("StatusId");
b.ToTable("Cartridges");
});
modelBuilder.Entity("CartriX.Api.Models.CartridgeModel", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int?>("PrinterId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("PrinterId");
b.ToTable("CartridgeModel");
});
modelBuilder.Entity("CartriX.Api.Models.Printer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("IpAddress")
.HasColumnType("TEXT");
b.Property<int>("ModelId")
.HasColumnType("INTEGER");
b.Property<int>("PrinterConnectionTypeId")
.HasColumnType("INTEGER");
b.Property<string>("PrinterName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("PrinterUsedPagesOID")
.HasColumnType("TEXT");
b.Property<int>("StatusId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("ModelId");
b.HasIndex("PrinterConnectionTypeId");
b.HasIndex("StatusId");
b.ToTable("Printers");
});
modelBuilder.Entity("CartriX.Api.Models.PrinterConnectionType", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("PrinterConnectionType");
b.HasData(
new
{
Id = 1,
Name = "Network"
},
new
{
Id = 2,
Name = "USB"
});
});
modelBuilder.Entity("CartriX.Api.Models.PrinterModel", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("PrinterModel");
});
modelBuilder.Entity("CartriX.Api.Models.StatusCartridge", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("StatusCartridges");
});
modelBuilder.Entity("CartriX.Api.Models.StatusPrinter", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("StatusPrinters");
});
modelBuilder.Entity("CartriX.Api.Models.SupportPrinterCartridges", b =>
{
b.Property<int>("PrinterModelId")
.HasColumnType("INTEGER");
b.HasIndex("PrinterModelId");
b.ToTable("SupportPrinterCartridges");
});
modelBuilder.Entity("CartriX.Api.Models.Cartridge", b =>
{
b.HasOne("CartriX.Api.Models.Printer", "InPrinter")
.WithMany("CartridgesHave")
.HasForeignKey("InPrinterId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("CartriX.Api.Models.CartridgeModel", "Model")
.WithMany()
.HasForeignKey("ModelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Models.StatusCartridge", "Status")
.WithMany()
.HasForeignKey("StatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("InPrinter");
b.Navigation("Model");
b.Navigation("Status");
});
modelBuilder.Entity("CartriX.Api.Models.CartridgeModel", b =>
{
b.HasOne("CartriX.Api.Models.Printer", null)
.WithMany("SupportCartridgeModels")
.HasForeignKey("PrinterId");
});
modelBuilder.Entity("CartriX.Api.Models.Printer", b =>
{
b.HasOne("CartriX.Api.Models.PrinterModel", "Model")
.WithMany()
.HasForeignKey("ModelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Models.PrinterConnectionType", "PrinterConnectionType")
.WithMany()
.HasForeignKey("PrinterConnectionTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CartriX.Api.Models.StatusPrinter", "Status")
.WithMany()
.HasForeignKey("StatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Model");
b.Navigation("PrinterConnectionType");
b.Navigation("Status");
});
modelBuilder.Entity("CartriX.Api.Models.SupportPrinterCartridges", b =>
{
b.HasOne("CartriX.Api.Models.PrinterModel", "PrinterModel")
.WithMany()
.HasForeignKey("PrinterModelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("PrinterModel");
});
modelBuilder.Entity("CartriX.Api.Models.Printer", b =>
{
b.Navigation("CartridgesHave");
b.Navigation("SupportCartridgeModels");
});
#pragma warning restore 612, 618
}
}
}