From 0ddfe833c412d8f43c0892319461fdc810e2143b Mon Sep 17 00:00:00 2001
From: maxnes3 <112558334+maxnes3@users.noreply.github.com>
Date: Thu, 2 Nov 2023 00:31:21 +0400
Subject: [PATCH] =?UTF-8?q?=D1=87=D1=82=D0=BE=D0=B1=D1=8B=20=D0=BD=D0=B5?=
=?UTF-8?q?=20=D0=B2=D1=81=D0=BA=D1=80=D1=8B=D1=82=D1=8C=D1=81=D1=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../20231101203036_InitMig.Designer.cs | 75 +++++++++++++++++++
.../Migrations/20231101203036_InitMig.cs | 55 ++++++++++++++
.../Migrations/DBContextModelSnapshot.cs | 72 ++++++++++++++++++
3 files changed, 202 insertions(+)
create mode 100644 WinForm/DataBaseImplement/Migrations/20231101203036_InitMig.Designer.cs
create mode 100644 WinForm/DataBaseImplement/Migrations/20231101203036_InitMig.cs
create mode 100644 WinForm/DataBaseImplement/Migrations/DBContextModelSnapshot.cs
diff --git a/WinForm/DataBaseImplement/Migrations/20231101203036_InitMig.Designer.cs b/WinForm/DataBaseImplement/Migrations/20231101203036_InitMig.Designer.cs
new file mode 100644
index 0000000..4162a39
--- /dev/null
+++ b/WinForm/DataBaseImplement/Migrations/20231101203036_InitMig.Designer.cs
@@ -0,0 +1,75 @@
+//
+using System;
+using DataBaseImplement;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace DataBaseImplement.Migrations
+{
+ [DbContext(typeof(DBContext))]
+ [Migration("20231101203036_InitMig")]
+ partial class InitMig
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.13")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("DataBaseImplement.Models.Provider", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Furniture")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("SupplyDate")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Providers");
+ });
+
+ modelBuilder.Entity("DataBaseImplement.Models.Type", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Types");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/WinForm/DataBaseImplement/Migrations/20231101203036_InitMig.cs b/WinForm/DataBaseImplement/Migrations/20231101203036_InitMig.cs
new file mode 100644
index 0000000..c5c48d9
--- /dev/null
+++ b/WinForm/DataBaseImplement/Migrations/20231101203036_InitMig.cs
@@ -0,0 +1,55 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace DataBaseImplement.Migrations
+{
+ ///
+ public partial class InitMig : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "Providers",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Name = table.Column(type: "text", nullable: false),
+ Type = table.Column(type: "text", nullable: false),
+ Furniture = table.Column(type: "text", nullable: false),
+ SupplyDate = table.Column(type: "timestamp with time zone", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Providers", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Types",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Name = table.Column(type: "text", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Types", x => x.Id);
+ });
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "Providers");
+
+ migrationBuilder.DropTable(
+ name: "Types");
+ }
+ }
+}
diff --git a/WinForm/DataBaseImplement/Migrations/DBContextModelSnapshot.cs b/WinForm/DataBaseImplement/Migrations/DBContextModelSnapshot.cs
new file mode 100644
index 0000000..57e0c1a
--- /dev/null
+++ b/WinForm/DataBaseImplement/Migrations/DBContextModelSnapshot.cs
@@ -0,0 +1,72 @@
+//
+using System;
+using DataBaseImplement;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace DataBaseImplement.Migrations
+{
+ [DbContext(typeof(DBContext))]
+ partial class DBContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.13")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("DataBaseImplement.Models.Provider", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Furniture")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("SupplyDate")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Providers");
+ });
+
+ modelBuilder.Entity("DataBaseImplement.Models.Type", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Types");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}