first commit -push
This commit is contained in:
131
RobotNet.RobotManager/Data/Migrations/20250509040621_AddRobotDb.Designer.cs
generated
Normal file
131
RobotNet.RobotManager/Data/Migrations/20250509040621_AddRobotDb.Designer.cs
generated
Normal file
@@ -0,0 +1,131 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using RobotNet.RobotManager.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace RobotNet.RobotManager.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(RobotEditorDbContext))]
|
||||
[Migration("20250509040621_AddRobotDb")]
|
||||
partial class AddRobotDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("RobotNet.RobotManager.Data.Robot", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<string>("ChargerNode")
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("ChargerNode");
|
||||
|
||||
b.Property<string>("HomeNode")
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("HomeNode");
|
||||
|
||||
b.Property<Guid>("MapId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("MapId");
|
||||
|
||||
b.Property<Guid>("ModelId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("ModelId");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("Name");
|
||||
|
||||
b.Property<string>("RobotId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("RobotId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MapId");
|
||||
|
||||
b.ToTable("Robots");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RobotNet.RobotManager.Data.RobotModel", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<int>("ImageHeight")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("ImageHeight");
|
||||
|
||||
b.Property<int>("ImageWidth")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("ImageWidth");
|
||||
|
||||
b.Property<double>("Length")
|
||||
.HasColumnType("float")
|
||||
.HasColumnName("Length");
|
||||
|
||||
b.Property<string>("ModelName")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("ModelName");
|
||||
|
||||
b.Property<int>("NavigationType")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("NavigationType");
|
||||
|
||||
b.Property<double>("OriginX")
|
||||
.HasColumnType("float")
|
||||
.HasColumnName("OriginX");
|
||||
|
||||
b.Property<double>("OriginY")
|
||||
.HasColumnType("float")
|
||||
.HasColumnName("OriginY");
|
||||
|
||||
b.Property<double>("Width")
|
||||
.HasColumnType("float")
|
||||
.HasColumnName("Width");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("RobotModels");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RobotNet.RobotManager.Data.Robot", b =>
|
||||
{
|
||||
b.HasOne("RobotNet.RobotManager.Data.RobotModel", "Model")
|
||||
.WithMany("Robots")
|
||||
.HasForeignKey("MapId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Model");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RobotNet.RobotManager.Data.RobotModel", b =>
|
||||
{
|
||||
b.Navigation("Robots");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace RobotNet.RobotManager.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddRobotDb : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RobotModels",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
ModelName = table.Column<string>(type: "varchar(127)", nullable: false),
|
||||
OriginX = table.Column<double>(type: "float", nullable: false),
|
||||
OriginY = table.Column<double>(type: "float", nullable: false),
|
||||
Length = table.Column<double>(type: "float", nullable: false),
|
||||
Width = table.Column<double>(type: "float", nullable: false),
|
||||
ImageWidth = table.Column<int>(type: "int", nullable: false),
|
||||
ImageHeight = table.Column<int>(type: "int", nullable: false),
|
||||
NavigationType = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RobotModels", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Robots",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
RobotId = table.Column<string>(type: "varchar(127)", nullable: false),
|
||||
Name = table.Column<string>(type: "varchar(127)", nullable: false),
|
||||
ModelId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
MapId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
HomeNode = table.Column<string>(type: "varchar(127)", nullable: true),
|
||||
ChargerNode = table.Column<string>(type: "varchar(127)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Robots", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Robots_RobotModels_MapId",
|
||||
column: x => x.MapId,
|
||||
principalTable: "RobotModels",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Robots_MapId",
|
||||
table: "Robots",
|
||||
column: "MapId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Robots");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "RobotModels");
|
||||
}
|
||||
}
|
||||
}
|
||||
131
RobotNet.RobotManager/Data/Migrations/20250509071716_fixRobotDb.Designer.cs
generated
Normal file
131
RobotNet.RobotManager/Data/Migrations/20250509071716_fixRobotDb.Designer.cs
generated
Normal file
@@ -0,0 +1,131 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using RobotNet.RobotManager.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace RobotNet.RobotManager.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(RobotEditorDbContext))]
|
||||
[Migration("20250509071716_fixRobotDb")]
|
||||
partial class fixRobotDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("RobotNet.RobotManager.Data.Robot", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<string>("ChargerNode")
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("ChargerNode");
|
||||
|
||||
b.Property<string>("HomeNode")
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("HomeNode");
|
||||
|
||||
b.Property<Guid>("MapId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("MapId");
|
||||
|
||||
b.Property<Guid>("ModelId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("ModelId");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("Name");
|
||||
|
||||
b.Property<string>("RobotId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("RobotId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ModelId");
|
||||
|
||||
b.ToTable("Robots");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RobotNet.RobotManager.Data.RobotModel", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<int>("ImageHeight")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("ImageHeight");
|
||||
|
||||
b.Property<int>("ImageWidth")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("ImageWidth");
|
||||
|
||||
b.Property<double>("Length")
|
||||
.HasColumnType("float")
|
||||
.HasColumnName("Length");
|
||||
|
||||
b.Property<string>("ModelName")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("ModelName");
|
||||
|
||||
b.Property<int>("NavigationType")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("NavigationType");
|
||||
|
||||
b.Property<double>("OriginX")
|
||||
.HasColumnType("float")
|
||||
.HasColumnName("OriginX");
|
||||
|
||||
b.Property<double>("OriginY")
|
||||
.HasColumnType("float")
|
||||
.HasColumnName("OriginY");
|
||||
|
||||
b.Property<double>("Width")
|
||||
.HasColumnType("float")
|
||||
.HasColumnName("Width");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("RobotModels");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RobotNet.RobotManager.Data.Robot", b =>
|
||||
{
|
||||
b.HasOne("RobotNet.RobotManager.Data.RobotModel", "Model")
|
||||
.WithMany("Robots")
|
||||
.HasForeignKey("ModelId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Model");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RobotNet.RobotManager.Data.RobotModel", b =>
|
||||
{
|
||||
b.Navigation("Robots");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace RobotNet.RobotManager.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class fixRobotDb : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Robots_RobotModels_MapId",
|
||||
table: "Robots");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Robots_MapId",
|
||||
table: "Robots");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Robots_ModelId",
|
||||
table: "Robots",
|
||||
column: "ModelId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Robots_RobotModels_ModelId",
|
||||
table: "Robots",
|
||||
column: "ModelId",
|
||||
principalTable: "RobotModels",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Robots_RobotModels_ModelId",
|
||||
table: "Robots");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Robots_ModelId",
|
||||
table: "Robots");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Robots_MapId",
|
||||
table: "Robots",
|
||||
column: "MapId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Robots_RobotModels_MapId",
|
||||
table: "Robots",
|
||||
column: "MapId",
|
||||
principalTable: "RobotModels",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using RobotNet.RobotManager.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace RobotNet.RobotManager.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(RobotEditorDbContext))]
|
||||
partial class RobotEditorDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("RobotNet.RobotManager.Data.Robot", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<string>("ChargerNode")
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("ChargerNode");
|
||||
|
||||
b.Property<string>("HomeNode")
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("HomeNode");
|
||||
|
||||
b.Property<Guid>("MapId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("MapId");
|
||||
|
||||
b.Property<Guid>("ModelId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("ModelId");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("Name");
|
||||
|
||||
b.Property<string>("RobotId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("RobotId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ModelId");
|
||||
|
||||
b.ToTable("Robots");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RobotNet.RobotManager.Data.RobotModel", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<int>("ImageHeight")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("ImageHeight");
|
||||
|
||||
b.Property<int>("ImageWidth")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("ImageWidth");
|
||||
|
||||
b.Property<double>("Length")
|
||||
.HasColumnType("float")
|
||||
.HasColumnName("Length");
|
||||
|
||||
b.Property<string>("ModelName")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(127)")
|
||||
.HasColumnName("ModelName");
|
||||
|
||||
b.Property<int>("NavigationType")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("NavigationType");
|
||||
|
||||
b.Property<double>("OriginX")
|
||||
.HasColumnType("float")
|
||||
.HasColumnName("OriginX");
|
||||
|
||||
b.Property<double>("OriginY")
|
||||
.HasColumnType("float")
|
||||
.HasColumnName("OriginY");
|
||||
|
||||
b.Property<double>("Width")
|
||||
.HasColumnType("float")
|
||||
.HasColumnName("Width");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("RobotModels");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RobotNet.RobotManager.Data.Robot", b =>
|
||||
{
|
||||
b.HasOne("RobotNet.RobotManager.Data.RobotModel", "Model")
|
||||
.WithMany("Robots")
|
||||
.HasForeignKey("ModelId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Model");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RobotNet.RobotManager.Data.RobotModel", b =>
|
||||
{
|
||||
b.Navigation("Robots");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user