From 73ad794bba33db04a4c6756d9d6c024f012babe0 Mon Sep 17 00:00:00 2001
From: DIMANRUS <41239551+DIMANRUS@users.noreply.github.com>
Date: Mon, 21 Aug 2023 19:56:41 +0300
Subject: [PATCH] v2.2.1
---
.../Views/Pages/PeripheryPage.axaml | 186 +++--
.../Views/Pages/PhonesPage.axaml | 1 +
.../Views/Windows/PeripheryWindow.axaml | 91 +--
.../Views/Windows/PhoneWindow.axaml | 133 ++--
.../20230821165312_v2.2.1.2.Designer.cs | 683 ++++++++++++++++++
.../Migrations/20230821165312_v2.2.1.2.cs | 40 +
.../SudInfoDbContextModelSnapshot.cs | 1 -
.../Models/Computer.cs | 1 -
8 files changed, 923 insertions(+), 213 deletions(-)
create mode 100644 src/SudInfo.EfDataAccessLibrary/Migrations/20230821165312_v2.2.1.2.Designer.cs
create mode 100644 src/SudInfo.EfDataAccessLibrary/Migrations/20230821165312_v2.2.1.2.cs
diff --git a/src/SudInfo.Avalonia/Views/Pages/PeripheryPage.axaml b/src/SudInfo.Avalonia/Views/Pages/PeripheryPage.axaml
index 555ebde..133ccad 100644
--- a/src/SudInfo.Avalonia/Views/Pages/PeripheryPage.axaml
+++ b/src/SudInfo.Avalonia/Views/Pages/PeripheryPage.axaml
@@ -12,105 +12,91 @@
d:DesignWidth="800"
x:DataType="viewModels:PeripheryPageViewModel"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/SudInfo.Avalonia/Views/Pages/PhonesPage.axaml b/src/SudInfo.Avalonia/Views/Pages/PhonesPage.axaml
index 0aadc84..8d6d76a 100644
--- a/src/SudInfo.Avalonia/Views/Pages/PhonesPage.axaml
+++ b/src/SudInfo.Avalonia/Views/Pages/PhonesPage.axaml
@@ -66,6 +66,7 @@
+
diff --git a/src/SudInfo.Avalonia/Views/Windows/PeripheryWindow.axaml b/src/SudInfo.Avalonia/Views/Windows/PeripheryWindow.axaml
index 57a2ad5..b440793 100644
--- a/src/SudInfo.Avalonia/Views/Windows/PeripheryWindow.axaml
+++ b/src/SudInfo.Avalonia/Views/Windows/PeripheryWindow.axaml
@@ -10,54 +10,55 @@
xmlns:viewModels="clr-namespace:SudInfo.Avalonia.ViewModels.WindowViewModels;assembly=SudInfo.Avalonia"
Title="Периферия"
Width="300"
- Height="300"
+ Height="330"
x:DataType="viewModels:PeripheryWindowViewModel"
CanResize="False"
WindowStartupLocation="CenterOwner"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
\ No newline at end of file
diff --git a/src/SudInfo.Avalonia/Views/Windows/PhoneWindow.axaml b/src/SudInfo.Avalonia/Views/Windows/PhoneWindow.axaml
index 6990671..96ed426 100644
--- a/src/SudInfo.Avalonia/Views/Windows/PhoneWindow.axaml
+++ b/src/SudInfo.Avalonia/Views/Windows/PhoneWindow.axaml
@@ -1,68 +1,69 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
\ No newline at end of file
diff --git a/src/SudInfo.EfDataAccessLibrary/Migrations/20230821165312_v2.2.1.2.Designer.cs b/src/SudInfo.EfDataAccessLibrary/Migrations/20230821165312_v2.2.1.2.Designer.cs
new file mode 100644
index 0000000..7ce9cb6
--- /dev/null
+++ b/src/SudInfo.EfDataAccessLibrary/Migrations/20230821165312_v2.2.1.2.Designer.cs
@@ -0,0 +1,683 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using SudInfo.EfDataAccessLibrary.Contexts;
+
+#nullable disable
+
+namespace SudInfo.EfDataAccessLibrary.Migrations
+{
+ [DbContext(typeof(SudInfoDatabaseContext))]
+ [Migration("20230821165312_v2.2.1.2")]
+ partial class v2212
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "7.0.0");
+
+ modelBuilder.Entity("AppEntityComputer", b =>
+ {
+ b.Property("AppsId")
+ .HasColumnType("INTEGER");
+
+ b.Property("ComputersId")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("AppsId", "ComputersId");
+
+ b.HasIndex("ComputersId");
+
+ b.ToTable("AppEntityComputer");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.AppEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("Version")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Apps");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.AppSetting", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Theme")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("AppSettings");
+
+ b.HasData(
+ new
+ {
+ Id = 1,
+ Theme = "Light"
+ });
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Cartridge", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("Remains")
+ .HasColumnType("INTEGER");
+
+ b.Property("Status")
+ .HasColumnType("INTEGER");
+
+ b.Property("Type")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.ToTable("Cartridges");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Computer", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("BreakdownDescription")
+ .HasMaxLength(200)
+ .HasColumnType("TEXT");
+
+ b.Property("CPU")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("GPU")
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("InventarNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("Ip")
+ .HasMaxLength(15)
+ .HasColumnType("TEXT");
+
+ b.Property("IsBroken")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsDecommissioned")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsStock")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsVks")
+ .HasColumnType("INTEGER");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("NumberCabinet")
+ .HasColumnType("INTEGER");
+
+ b.Property("OS")
+ .HasColumnType("INTEGER");
+
+ b.Property("RAM")
+ .HasColumnType("INTEGER");
+
+ b.Property("ROM")
+ .HasColumnType("INTEGER");
+
+ b.Property("SerialNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .HasColumnType("INTEGER");
+
+ b.Property("YearRelease")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Computers");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Contact", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("TEXT");
+
+ b.Property("Email")
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("Phone")
+ .HasMaxLength(11)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Contacts");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Monitor", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("BreakdownDescription")
+ .HasMaxLength(200)
+ .HasColumnType("TEXT");
+
+ b.Property("ComputerId")
+ .HasColumnType("INTEGER");
+
+ b.Property("InventarNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("IsBroken")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsDecommissioned")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsStock")
+ .HasColumnType("INTEGER");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("ScreenResolutionHeight")
+ .HasColumnType("INTEGER");
+
+ b.Property("ScreenResolutionWidth")
+ .HasColumnType("INTEGER");
+
+ b.Property("ScreenSize")
+ .HasColumnType("INTEGER");
+
+ b.Property("SerialNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("YearRelease")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ComputerId");
+
+ b.ToTable("Monitors");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.PasswordEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("TEXT");
+
+ b.Property("Link")
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("Login")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("Password")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Passwords");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Periphery", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ComputerId")
+ .HasColumnType("INTEGER");
+
+ b.Property("InventarNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("IsPersonal")
+ .HasColumnType("INTEGER");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("SerialNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("Type")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ComputerId");
+
+ b.ToTable("Peripheries");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Phone", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("BreakdownDescription")
+ .HasMaxLength(200)
+ .HasColumnType("TEXT");
+
+ b.Property("InventarNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("IsBroken")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsDecommissioned")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsPersonal")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsStock")
+ .HasColumnType("INTEGER");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("SerialNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Phones");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Printer", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("BreakdownDescription")
+ .HasMaxLength(200)
+ .HasColumnType("TEXT");
+
+ b.Property("ComputerId")
+ .HasColumnType("INTEGER");
+
+ b.Property("InventarNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("Ip")
+ .HasMaxLength(15)
+ .HasColumnType("TEXT");
+
+ b.Property("IsBroken")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsDecommissioned")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsStock")
+ .HasColumnType("INTEGER");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("NumberCabinet")
+ .HasColumnType("INTEGER");
+
+ b.Property("SerialNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("Type")
+ .HasColumnType("INTEGER");
+
+ b.Property("YearRelease")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ComputerId");
+
+ b.ToTable("Printers");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Rutoken", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("EndDateCertificate")
+ .HasColumnType("TEXT");
+
+ b.Property("NumberCertificate")
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("SerialNumberRutoken")
+ .HasMaxLength(30)
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Rutokens");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Server", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("InventarNumber")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("IpAddress")
+ .HasMaxLength(15)
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("OperatingSystem")
+ .HasColumnType("INTEGER");
+
+ b.Property("PosiitionInServerRack")
+ .HasColumnType("INTEGER");
+
+ b.Property("SerialNumber")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("ServerRackId")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ServerRackId");
+
+ b.ToTable("Servers");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.ServerRack", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("InventarNumber")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("Position")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Position")
+ .IsUnique();
+
+ b.ToTable("ServerRacks");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.TaskEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("TEXT");
+
+ b.Property("ReminderTime")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Tasks");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.User", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("TEXT");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("TEXT");
+
+ b.Property("LocalPhone")
+ .HasMaxLength(3)
+ .HasColumnType("TEXT");
+
+ b.Property("MiddleName")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("TEXT");
+
+ b.Property("NumberCabinet")
+ .HasColumnType("INTEGER");
+
+ b.Property("PersonalPhone")
+ .HasMaxLength(11)
+ .HasColumnType("TEXT");
+
+ b.Property("WorkPhone")
+ .HasMaxLength(11)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Users");
+ });
+
+ modelBuilder.Entity("AppEntityComputer", b =>
+ {
+ b.HasOne("SudInfo.EfDataAccessLibrary.Models.AppEntity", null)
+ .WithMany()
+ .HasForeignKey("AppsId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("SudInfo.EfDataAccessLibrary.Models.Computer", null)
+ .WithMany()
+ .HasForeignKey("ComputersId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Computer", b =>
+ {
+ b.HasOne("SudInfo.EfDataAccessLibrary.Models.User", "User")
+ .WithMany("Computers")
+ .HasForeignKey("UserId");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Monitor", b =>
+ {
+ b.HasOne("SudInfo.EfDataAccessLibrary.Models.Computer", "Computer")
+ .WithMany("Monitors")
+ .HasForeignKey("ComputerId");
+
+ b.Navigation("Computer");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Periphery", b =>
+ {
+ b.HasOne("SudInfo.EfDataAccessLibrary.Models.Computer", "Computer")
+ .WithMany("Peripheries")
+ .HasForeignKey("ComputerId");
+
+ b.Navigation("Computer");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Phone", b =>
+ {
+ b.HasOne("SudInfo.EfDataAccessLibrary.Models.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Printer", b =>
+ {
+ b.HasOne("SudInfo.EfDataAccessLibrary.Models.Computer", "Computer")
+ .WithMany("Printers")
+ .HasForeignKey("ComputerId");
+
+ b.Navigation("Computer");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Rutoken", b =>
+ {
+ b.HasOne("SudInfo.EfDataAccessLibrary.Models.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Server", b =>
+ {
+ b.HasOne("SudInfo.EfDataAccessLibrary.Models.ServerRack", "ServerRack")
+ .WithMany("Servers")
+ .HasForeignKey("ServerRackId");
+
+ b.Navigation("ServerRack");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.Computer", b =>
+ {
+ b.Navigation("Monitors");
+
+ b.Navigation("Peripheries");
+
+ b.Navigation("Printers");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.ServerRack", b =>
+ {
+ b.Navigation("Servers");
+ });
+
+ modelBuilder.Entity("SudInfo.EfDataAccessLibrary.Models.User", b =>
+ {
+ b.Navigation("Computers");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/SudInfo.EfDataAccessLibrary/Migrations/20230821165312_v2.2.1.2.cs b/src/SudInfo.EfDataAccessLibrary/Migrations/20230821165312_v2.2.1.2.cs
new file mode 100644
index 0000000..2ff7885
--- /dev/null
+++ b/src/SudInfo.EfDataAccessLibrary/Migrations/20230821165312_v2.2.1.2.cs
@@ -0,0 +1,40 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace SudInfo.EfDataAccessLibrary.Migrations
+{
+ ///
+ public partial class v2212 : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterColumn(
+ name: "Ip",
+ table: "Computers",
+ type: "TEXT",
+ maxLength: 15,
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "TEXT",
+ oldMaxLength: 15);
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterColumn(
+ name: "Ip",
+ table: "Computers",
+ type: "TEXT",
+ maxLength: 15,
+ nullable: false,
+ defaultValue: "",
+ oldClrType: typeof(string),
+ oldType: "TEXT",
+ oldMaxLength: 15,
+ oldNullable: true);
+ }
+ }
+}
diff --git a/src/SudInfo.EfDataAccessLibrary/Migrations/SudInfoDbContextModelSnapshot.cs b/src/SudInfo.EfDataAccessLibrary/Migrations/SudInfoDbContextModelSnapshot.cs
index d692afa..b0ab54c 100644
--- a/src/SudInfo.EfDataAccessLibrary/Migrations/SudInfoDbContextModelSnapshot.cs
+++ b/src/SudInfo.EfDataAccessLibrary/Migrations/SudInfoDbContextModelSnapshot.cs
@@ -126,7 +126,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("TEXT");
b.Property("Ip")
- .IsRequired()
.HasMaxLength(15)
.HasColumnType("TEXT");
diff --git a/src/SudInfo.EfDataAccessLibrary/Models/Computer.cs b/src/SudInfo.EfDataAccessLibrary/Models/Computer.cs
index 4f1f8e6..4cc0409 100644
--- a/src/SudInfo.EfDataAccessLibrary/Models/Computer.cs
+++ b/src/SudInfo.EfDataAccessLibrary/Models/Computer.cs
@@ -3,7 +3,6 @@
public class Computer : BaseModel
{
[XLColumn(Header = "IP адрес")]
- [Required(ErrorMessage = Const.FieldRequired)]
[StringLength(15)]
[RegularExpression(Const.Ip4RegularExpression, ErrorMessage = Const.NotValidIp4Message)]
public string? Ip { get; set; }