mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 20:40:55 +00:00
489 lines
16 KiB
C#
489 lines
16 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("20260529183129_Init6")]
|
||
partial class Init6
|
||
{
|
||
/// <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>("SupportedArticlesId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.Property<int>("SupportedCartridgeModelsId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.HasKey("SupportedArticlesId", "SupportedCartridgeModelsId");
|
||
|
||
b.HasIndex("SupportedCartridgeModelsId");
|
||
|
||
b.ToTable("ArticleCartridgeModel");
|
||
});
|
||
|
||
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>("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.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.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>("PrinterStatusId")
|
||
.HasColumnType("INTEGER");
|
||
|
||
b.HasKey("Id");
|
||
|
||
b.HasIndex("LocationId");
|
||
|
||
b.HasIndex("ModelId");
|
||
|
||
b.HasIndex("Name")
|
||
.IsUnique();
|
||
|
||
b.HasIndex("PrintTypeId");
|
||
|
||
b.HasIndex("PrinterConnetctionTypeId");
|
||
|
||
b.HasIndex("PrinterStatusId");
|
||
|
||
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<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("ArticleCartridgeModel", b =>
|
||
{
|
||
b.HasOne("CartriX.Api.Entities.Article", null)
|
||
.WithMany()
|
||
.HasForeignKey("SupportedArticlesId")
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.IsRequired();
|
||
|
||
b.HasOne("CartriX.Api.Entities.CartridgeModel", null)
|
||
.WithMany()
|
||
.HasForeignKey("SupportedCartridgeModelsId")
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.IsRequired();
|
||
});
|
||
|
||
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", "connetctionType")
|
||
.WithMany()
|
||
.HasForeignKey("PrinterConnetctionTypeId")
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.IsRequired();
|
||
|
||
b.HasOne("CartriX.Api.Entities.PrinterStatus", "status")
|
||
.WithMany()
|
||
.HasForeignKey("PrinterStatusId")
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.IsRequired();
|
||
|
||
b.Navigation("Location");
|
||
|
||
b.Navigation("Model");
|
||
|
||
b.Navigation("PrintType");
|
||
|
||
b.Navigation("connetctionType");
|
||
|
||
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.Article", "SupportedArticle")
|
||
.WithOne("SupportedPrinterModel")
|
||
.HasForeignKey("CartriX.Api.Entities.PrinterModel", "SupportedArticleId")
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.IsRequired();
|
||
|
||
b.Navigation("Manufacturer");
|
||
|
||
b.Navigation("SupportedArticle");
|
||
});
|
||
|
||
modelBuilder.Entity("CartriX.Api.Entities.Article", b =>
|
||
{
|
||
b.Navigation("SupportedPrinterModel");
|
||
});
|
||
|
||
modelBuilder.Entity("CartriX.Api.Entities.Location", b =>
|
||
{
|
||
b.Navigation("Printers");
|
||
});
|
||
|
||
modelBuilder.Entity("CartriX.Api.Entities.Printer", b =>
|
||
{
|
||
b.Navigation("InstalledCartridge");
|
||
});
|
||
#pragma warning restore 612, 618
|
||
}
|
||
}
|
||
}
|