feat(esppOrderLoader): логика синхронизации
This commit is contained in:
2625
PARR.DAL/Migrations/20231023052610_TblOrdersAndStatus.Designer.cs
generated
Normal file
2625
PARR.DAL/Migrations/20231023052610_TblOrdersAndStatus.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
91
PARR.DAL/Migrations/20231023052610_TblOrdersAndStatus.cs
Normal file
91
PARR.DAL/Migrations/20231023052610_TblOrdersAndStatus.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class TblOrdersAndStatus : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "OrderStatuses",
|
||||
columns: table => new
|
||||
{
|
||||
Code = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Description = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_OrderStatuses", x => x.Code);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Orders",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
Number = table.Column<string>(type: "text", nullable: false),
|
||||
WorkGroup = table.Column<string>(type: "text", nullable: true),
|
||||
TemplateId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
OrderStatusCode = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Orders", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Orders_OrderStatuses_OrderStatusCode",
|
||||
column: x => x.OrderStatusCode,
|
||||
principalTable: "OrderStatuses",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Orders_Templates_TemplateId",
|
||||
column: x => x.TemplateId,
|
||||
principalTable: "Templates",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "OrderStatuses",
|
||||
columns: new[] { "Code", "Description", "Name" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "1-Направлен в группу", "New" },
|
||||
{ 2, "2-В работе", "InWork" },
|
||||
{ 3, "3-Приостановлен", "Stop" },
|
||||
{ 4, "4-Выполнен", "Complete" },
|
||||
{ 5, "5-Закрыт", "Closed" }
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Orders_OrderStatusCode",
|
||||
table: "Orders",
|
||||
column: "OrderStatusCode");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Orders_TemplateId",
|
||||
table: "Orders",
|
||||
column: "TemplateId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Orders");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "OrderStatuses");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1547,6 +1547,90 @@ namespace PARR.DAL.Migrations
|
||||
b.ToTable("Hosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Order", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("OrderStatusCode")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<Guid?>("TemplateId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("WorkGroup")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("OrderStatusCode");
|
||||
|
||||
b.HasIndex("TemplateId");
|
||||
|
||||
b.ToTable("Orders");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.OrderStatus", b =>
|
||||
{
|
||||
b.Property<int>("Code")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Code"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Code");
|
||||
|
||||
b.ToTable("OrderStatuses");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Code = 1,
|
||||
Description = "1-Направлен в группу",
|
||||
Name = "New"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 2,
|
||||
Description = "2-В работе",
|
||||
Name = "InWork"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 3,
|
||||
Description = "3-Приостановлен",
|
||||
Name = "Stop"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 4,
|
||||
Description = "4-Выполнен",
|
||||
Name = "Complete"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 5,
|
||||
Description = "5-Закрыт",
|
||||
Name = "Closed"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Process", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -2278,6 +2362,23 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("ResponseArea");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Order", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.OrderStatus", "OrderStatus")
|
||||
.WithMany("Orders")
|
||||
.HasForeignKey("OrderStatusCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.Template", "Template")
|
||||
.WithMany("Orders")
|
||||
.HasForeignKey("TemplateId");
|
||||
|
||||
b.Navigation("OrderStatus");
|
||||
|
||||
b.Navigation("Template");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.RobotConfiguration", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.Robot", "Robot")
|
||||
@@ -2450,6 +2551,11 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Templates");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.OrderStatus", b =>
|
||||
{
|
||||
b.Navigation("Orders");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Process", b =>
|
||||
{
|
||||
b.Navigation("Subprocesses");
|
||||
@@ -2496,6 +2602,8 @@ namespace PARR.DAL.Migrations
|
||||
{
|
||||
b.Navigation("AgentHistories");
|
||||
|
||||
b.Navigation("Orders");
|
||||
|
||||
b.Navigation("RobotConfigurations");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user