Initial commit

This commit is contained in:
2026-07-13 09:25:40 +07:00
parent c08ff54676
commit bccfb156d7
1938 changed files with 641646 additions and 0 deletions

View File

@@ -0,0 +1,397 @@
// <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 RobotNet10.FleetManager.Data;
#nullable disable
namespace RobotNet10.FleetManager.Data.Migrations.AppDb
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20260209025755_AddAppDb")]
partial class AddAppDb
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderKey")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("Name")
.HasColumnType("nvarchar(450)");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("RobotNet10.FleetManager.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("RobotNet10.FleetManager.Data.Robot", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<Guid?>("MapId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("ModelId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("RobotId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime?>("UpdatedDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("MapId")
.HasDatabaseName("IX_Robots_MapId");
b.HasIndex("ModelId")
.HasDatabaseName("IX_Robots_ModelId");
b.HasIndex("RobotId")
.IsUnique()
.HasDatabaseName("UX_Robots_RobotId");
b.ToTable("Robots");
});
modelBuilder.Entity("RobotNet10.FleetManager.Data.RobotModel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<int>("ImageHeight")
.HasColumnType("int");
b.Property<int>("ImageWidth")
.HasColumnType("int");
b.Property<double>("Length")
.HasPrecision(18, 2)
.HasColumnType("float(18)");
b.Property<string>("ModelName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<double>("NavigationPointX")
.HasPrecision(18, 2)
.HasColumnType("float(18)");
b.Property<double>("NavigationPointY")
.HasPrecision(18, 2)
.HasColumnType("float(18)");
b.Property<int>("NavigationType")
.HasColumnType("int");
b.Property<DateTime?>("UpdatedDate")
.HasColumnType("datetime2");
b.Property<Guid?>("VehicleTypeId")
.HasColumnType("uniqueidentifier");
b.Property<double>("Width")
.HasPrecision(18, 2)
.HasColumnType("float(18)");
b.HasKey("Id");
b.HasIndex("ModelName")
.HasDatabaseName("IX_RobotModels_ModelName");
b.HasIndex("NavigationType")
.HasDatabaseName("IX_RobotModels_NavigationType");
b.HasIndex("VehicleTypeId")
.HasDatabaseName("IX_RobotModels_VehicleTypeId");
b.ToTable("RobotModels");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("RobotNet10.FleetManager.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("RobotNet10.FleetManager.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("RobotNet10.FleetManager.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("RobotNet10.FleetManager.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RobotNet10.FleetManager.Data.Robot", b =>
{
b.HasOne("RobotNet10.FleetManager.Data.RobotModel", "Model")
.WithMany("Robots")
.HasForeignKey("ModelId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Model");
});
modelBuilder.Entity("RobotNet10.FleetManager.Data.RobotModel", b =>
{
b.Navigation("Robots");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,306 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RobotNet10.FleetManager.Data.Migrations.AppDb
{
/// <inheritdoc />
public partial class AddAppDb : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AspNetRoles",
columns: table => new
{
Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetUsers",
columns: table => new
{
Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
Email = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(type: "bit", nullable: false),
PasswordHash = table.Column<string>(type: "nvarchar(max)", nullable: true),
SecurityStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
PhoneNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "bit", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "bit", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
LockoutEnabled = table.Column<bool>(type: "bit", nullable: false),
AccessFailedCount = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RobotModels",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ModelName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
Length = table.Column<double>(type: "float(18)", precision: 18, scale: 2, nullable: false),
Width = table.Column<double>(type: "float(18)", precision: 18, scale: 2, nullable: false),
ImageWidth = table.Column<int>(type: "int", nullable: false),
ImageHeight = table.Column<int>(type: "int", nullable: false),
NavigationPointX = table.Column<double>(type: "float(18)", precision: 18, scale: 2, nullable: false),
NavigationPointY = table.Column<double>(type: "float(18)", precision: 18, scale: 2, nullable: false),
NavigationType = table.Column<int>(type: "int", nullable: false),
VehicleTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
UpdatedDate = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RobotModels", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetRoleClaims",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false),
ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserClaims",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetUserClaims_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserLogins",
columns: table => new
{
LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
ProviderKey = table.Column<string>(type: "nvarchar(450)", nullable: false),
ProviderDisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
table.ForeignKey(
name: "FK_AspNetUserLogins_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserRoles",
columns: table => new
{
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserTokens",
columns: table => new
{
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
Name = table.Column<string>(type: "nvarchar(450)", nullable: false),
Value = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Robots",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
RobotId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
ModelId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
MapId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
UpdatedDate = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Robots", x => x.Id);
table.ForeignKey(
name: "FK_Robots_RobotModels_ModelId",
column: x => x.ModelId,
principalTable: "RobotModels",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId",
table: "AspNetRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true,
filter: "[NormalizedName] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserClaims_UserId",
table: "AspNetUserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserLogins_UserId",
table: "AspNetUserLogins",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserRoles_RoleId",
table: "AspNetUserRoles",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "EmailIndex",
table: "AspNetUsers",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true,
filter: "[NormalizedUserName] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_RobotModels_ModelName",
table: "RobotModels",
column: "ModelName");
migrationBuilder.CreateIndex(
name: "IX_RobotModels_NavigationType",
table: "RobotModels",
column: "NavigationType");
migrationBuilder.CreateIndex(
name: "IX_RobotModels_VehicleTypeId",
table: "RobotModels",
column: "VehicleTypeId");
migrationBuilder.CreateIndex(
name: "IX_Robots_MapId",
table: "Robots",
column: "MapId");
migrationBuilder.CreateIndex(
name: "IX_Robots_ModelId",
table: "Robots",
column: "ModelId");
migrationBuilder.CreateIndex(
name: "UX_Robots_RobotId",
table: "Robots",
column: "RobotId",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AspNetRoleClaims");
migrationBuilder.DropTable(
name: "AspNetUserClaims");
migrationBuilder.DropTable(
name: "AspNetUserLogins");
migrationBuilder.DropTable(
name: "AspNetUserRoles");
migrationBuilder.DropTable(
name: "AspNetUserTokens");
migrationBuilder.DropTable(
name: "Robots");
migrationBuilder.DropTable(
name: "AspNetRoles");
migrationBuilder.DropTable(
name: "AspNetUsers");
migrationBuilder.DropTable(
name: "RobotModels");
}
}
}

View File

@@ -0,0 +1,394 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet10.FleetManager.Data;
#nullable disable
namespace RobotNet10.FleetManager.Data.Migrations.AppDb
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderKey")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("Name")
.HasColumnType("nvarchar(450)");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("RobotNet10.FleetManager.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("RobotNet10.FleetManager.Data.Robot", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<Guid?>("MapId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("ModelId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("RobotId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime?>("UpdatedDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("MapId")
.HasDatabaseName("IX_Robots_MapId");
b.HasIndex("ModelId")
.HasDatabaseName("IX_Robots_ModelId");
b.HasIndex("RobotId")
.IsUnique()
.HasDatabaseName("UX_Robots_RobotId");
b.ToTable("Robots");
});
modelBuilder.Entity("RobotNet10.FleetManager.Data.RobotModel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<int>("ImageHeight")
.HasColumnType("int");
b.Property<int>("ImageWidth")
.HasColumnType("int");
b.Property<double>("Length")
.HasPrecision(18, 2)
.HasColumnType("float(18)");
b.Property<string>("ModelName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<double>("NavigationPointX")
.HasPrecision(18, 2)
.HasColumnType("float(18)");
b.Property<double>("NavigationPointY")
.HasPrecision(18, 2)
.HasColumnType("float(18)");
b.Property<int>("NavigationType")
.HasColumnType("int");
b.Property<DateTime?>("UpdatedDate")
.HasColumnType("datetime2");
b.Property<Guid?>("VehicleTypeId")
.HasColumnType("uniqueidentifier");
b.Property<double>("Width")
.HasPrecision(18, 2)
.HasColumnType("float(18)");
b.HasKey("Id");
b.HasIndex("ModelName")
.HasDatabaseName("IX_RobotModels_ModelName");
b.HasIndex("NavigationType")
.HasDatabaseName("IX_RobotModels_NavigationType");
b.HasIndex("VehicleTypeId")
.HasDatabaseName("IX_RobotModels_VehicleTypeId");
b.ToTable("RobotModels");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("RobotNet10.FleetManager.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("RobotNet10.FleetManager.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("RobotNet10.FleetManager.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("RobotNet10.FleetManager.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RobotNet10.FleetManager.Data.Robot", b =>
{
b.HasOne("RobotNet10.FleetManager.Data.RobotModel", "Model")
.WithMany("Robots")
.HasForeignKey("ModelId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Model");
});
modelBuilder.Entity("RobotNet10.FleetManager.Data.RobotModel", b =>
{
b.Navigation("Robots");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,710 @@
// <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 RobotNet10.MapManager.Data;
#nullable disable
namespace RobotNet10.FleetManager.Data.Migrations.MapDb
{
[DbContext(typeof(MapDbContext))]
[Migration("20260305070805_AddMapDb")]
partial class AddMapDb
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("RobotNet10.MapManager.Data.Edge", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("EdgeDescription")
.HasColumnType("nvarchar(max)");
b.Property<string>("EdgeId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("EdgeName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<Guid>("EndNodeId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("LevelId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("StartNodeId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("EdgeId");
b.HasIndex("EndNodeId");
b.HasIndex("StartNodeId");
b.HasIndex("LevelId", "EdgeId")
.IsUnique();
b.ToTable("Edges", t =>
{
t.HasCheckConstraint("CK_Edges_DifferentNodes", "[StartNodeId] <> [EndNodeId]");
});
});
modelBuilder.Entity("RobotNet10.MapManager.Data.EdgeVehicleProperty", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Actions")
.HasColumnType("nvarchar(max)");
b.Property<double?>("CorridorLeftWidth")
.HasColumnType("float");
b.Property<int?>("CorridorRefPoint")
.HasColumnType("int");
b.Property<double?>("CorridorRightWidth")
.HasColumnType("float");
b.Property<Guid>("EdgeId")
.HasColumnType("uniqueidentifier");
b.Property<string>("LoadRestriction_LoadSetNames")
.HasColumnType("nvarchar(max)");
b.Property<bool?>("LoadRestriction_Loaded")
.HasColumnType("bit");
b.Property<bool?>("LoadRestriction_Unloaded")
.HasColumnType("bit");
b.Property<double?>("MaxHeight")
.HasColumnType("float");
b.Property<double?>("MaxRotationSpeed")
.HasColumnType("float");
b.Property<double?>("MaxSpeed")
.HasColumnType("float");
b.Property<double?>("MinHeight")
.HasColumnType("float");
b.Property<int?>("OrientationType")
.HasColumnType("int");
b.Property<bool?>("RotationAllowed")
.HasColumnType("bit");
b.Property<int?>("RotationAtEndNodeAllowed")
.HasColumnType("int");
b.Property<int?>("RotationAtStartNodeAllowed")
.HasColumnType("int");
b.Property<double?>("TrajectoryControlPoint1X")
.HasColumnType("float");
b.Property<double?>("TrajectoryControlPoint1Y")
.HasColumnType("float");
b.Property<double?>("TrajectoryControlPoint2X")
.HasColumnType("float");
b.Property<double?>("TrajectoryControlPoint2Y")
.HasColumnType("float");
b.Property<int?>("TrajectoryDegree")
.HasColumnType("int");
b.Property<double?>("VehicleOrientation")
.HasColumnType("float");
b.Property<Guid>("VehicleTypeId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("EdgeId");
b.HasIndex("VehicleTypeId");
b.HasIndex("EdgeId", "VehicleTypeId")
.IsUnique();
b.ToTable("EdgeVehicleProperties");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Layout", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedBy")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<string>("LayoutId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("LayoutName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("ModifiedBy")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<DateTime>("ModifiedDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("IsActive");
b.HasIndex("LayoutId")
.IsUnique();
b.ToTable("Layouts");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutLevel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("LayoutLevelId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int>("LevelOrder")
.HasColumnType("int");
b.Property<Guid>("VersionId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("LevelOrder");
b.HasIndex("VersionId", "LayoutLevelId")
.IsUnique();
b.ToTable("LayoutLevels");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutLevelEditorSettings", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<double?>("BoundsMaxX")
.HasColumnType("float");
b.Property<double?>("BoundsMaxY")
.HasColumnType("float");
b.Property<double?>("BoundsMinX")
.HasColumnType("float");
b.Property<double?>("BoundsMinY")
.HasColumnType("float");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<double>("EdgeMinLengthCreate")
.HasColumnType("float");
b.Property<bool>("EdgeNameAutoGenerate")
.HasColumnType("bit");
b.Property<double?>("ImageHeight")
.HasColumnType("float");
b.Property<double?>("ImageWidth")
.HasColumnType("float");
b.Property<Guid>("LevelId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("ModifiedDate")
.HasColumnType("datetime2");
b.Property<bool>("NodeNameAutoGenerate")
.HasColumnType("bit");
b.Property<double>("NodeProximityRadius")
.HasColumnType("float");
b.Property<double>("OriginX")
.HasColumnType("float");
b.Property<double>("OriginY")
.HasColumnType("float");
b.Property<double>("Resolution")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("LevelId")
.IsUnique();
b.ToTable("LayoutLevelEditorSettings");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedBy")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<string>("LayoutDescription")
.HasColumnType("nvarchar(max)");
b.Property<Guid>("LayoutId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.HasKey("Id");
b.HasIndex("IsActive");
b.HasIndex("LayoutId", "Version")
.IsUnique();
b.ToTable("LayoutVersions");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Node", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("LevelId")
.HasColumnType("uniqueidentifier");
b.Property<string>("MapId")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("NodeDescription")
.HasColumnType("nvarchar(max)");
b.Property<string>("NodeId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("NodeName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<double>("X")
.HasColumnType("float");
b.Property<double>("Y")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("MapId");
b.HasIndex("NodeId");
b.HasIndex("LevelId", "NodeId")
.IsUnique();
b.HasIndex("X", "Y");
b.ToTable("Nodes");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.NodeVehicleProperty", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Actions")
.HasColumnType("nvarchar(max)");
b.Property<double?>("AllowedDeviationTheta")
.HasColumnType("float");
b.Property<double?>("AllowedDeviationXY")
.HasColumnType("float");
b.Property<Guid>("NodeId")
.HasColumnType("uniqueidentifier");
b.Property<double?>("Theta")
.HasColumnType("float");
b.Property<Guid>("VehicleTypeId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("NodeId");
b.HasIndex("VehicleTypeId");
b.HasIndex("NodeId", "VehicleTypeId")
.IsUnique();
b.ToTable("NodeVehicleProperties");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Station", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("LevelId")
.HasColumnType("uniqueidentifier");
b.Property<string>("StationDescription")
.HasColumnType("nvarchar(max)");
b.Property<double?>("StationHeight")
.HasColumnType("float");
b.Property<string>("StationId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("StationName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<double?>("Theta")
.HasColumnType("float");
b.Property<double>("X")
.HasColumnType("float");
b.Property<double>("Y")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("StationId");
b.HasIndex("LevelId", "StationId")
.IsUnique();
b.ToTable("Stations");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.StationInteractionNode", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("NodeId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("StationId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("NodeId");
b.HasIndex("StationId");
b.HasIndex("StationId", "NodeId")
.IsUnique();
b.ToTable("StationInteractionNodes");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.VehicleType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Actions")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<string>("Specifications")
.HasColumnType("nvarchar(max)");
b.Property<string>("VehicleTypeId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("VehicleTypeName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("IsActive");
b.HasIndex("VehicleTypeId")
.IsUnique();
b.ToTable("VehicleTypes");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Edge", b =>
{
b.HasOne("RobotNet10.MapManager.Data.Node", "EndNode")
.WithMany("IncomingEdges")
.HasForeignKey("EndNodeId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("RobotNet10.MapManager.Data.LayoutLevel", "Level")
.WithMany("Edges")
.HasForeignKey("LevelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("RobotNet10.MapManager.Data.Node", "StartNode")
.WithMany("OutgoingEdges")
.HasForeignKey("StartNodeId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("EndNode");
b.Navigation("Level");
b.Navigation("StartNode");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.EdgeVehicleProperty", b =>
{
b.HasOne("RobotNet10.MapManager.Data.Edge", "Edge")
.WithMany("VehicleProperties")
.HasForeignKey("EdgeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("RobotNet10.MapManager.Data.VehicleType", "VehicleType")
.WithMany("EdgeVehicleProperties")
.HasForeignKey("VehicleTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Edge");
b.Navigation("VehicleType");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutLevel", b =>
{
b.HasOne("RobotNet10.MapManager.Data.LayoutVersion", "Version")
.WithMany("Levels")
.HasForeignKey("VersionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Version");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutLevelEditorSettings", b =>
{
b.HasOne("RobotNet10.MapManager.Data.LayoutLevel", "Level")
.WithOne("EditorSettings")
.HasForeignKey("RobotNet10.MapManager.Data.LayoutLevelEditorSettings", "LevelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Level");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutVersion", b =>
{
b.HasOne("RobotNet10.MapManager.Data.Layout", "Layout")
.WithMany("Versions")
.HasForeignKey("LayoutId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Layout");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Node", b =>
{
b.HasOne("RobotNet10.MapManager.Data.LayoutLevel", "Level")
.WithMany("Nodes")
.HasForeignKey("LevelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Level");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.NodeVehicleProperty", b =>
{
b.HasOne("RobotNet10.MapManager.Data.Node", "Node")
.WithMany("VehicleProperties")
.HasForeignKey("NodeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("RobotNet10.MapManager.Data.VehicleType", "VehicleType")
.WithMany("NodeVehicleProperties")
.HasForeignKey("VehicleTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Node");
b.Navigation("VehicleType");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Station", b =>
{
b.HasOne("RobotNet10.MapManager.Data.LayoutLevel", "Level")
.WithMany("Stations")
.HasForeignKey("LevelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Level");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.StationInteractionNode", b =>
{
b.HasOne("RobotNet10.MapManager.Data.Node", "Node")
.WithMany("StationInteractions")
.HasForeignKey("NodeId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("RobotNet10.MapManager.Data.Station", "Station")
.WithMany("InteractionNodes")
.HasForeignKey("StationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Node");
b.Navigation("Station");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Edge", b =>
{
b.Navigation("VehicleProperties");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Layout", b =>
{
b.Navigation("Versions");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutLevel", b =>
{
b.Navigation("Edges");
b.Navigation("EditorSettings");
b.Navigation("Nodes");
b.Navigation("Stations");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutVersion", b =>
{
b.Navigation("Levels");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Node", b =>
{
b.Navigation("IncomingEdges");
b.Navigation("OutgoingEdges");
b.Navigation("StationInteractions");
b.Navigation("VehicleProperties");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Station", b =>
{
b.Navigation("InteractionNodes");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.VehicleType", b =>
{
b.Navigation("EdgeVehicleProperties");
b.Navigation("NodeVehicleProperties");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,501 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RobotNet10.FleetManager.Data.Migrations.MapDb
{
/// <inheritdoc />
public partial class AddMapDb : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Layouts",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
LayoutId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
LayoutName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false),
CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ModifiedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatedBy = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
ModifiedBy = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Layouts", x => x.Id);
});
migrationBuilder.CreateTable(
name: "VehicleTypes",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
VehicleTypeId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
VehicleTypeName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
Specifications = table.Column<string>(type: "nvarchar(max)", nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false),
Actions = table.Column<string>(type: "nvarchar(max)", nullable: true),
CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_VehicleTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "LayoutVersions",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
LayoutId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Version = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
LayoutDescription = table.Column<string>(type: "nvarchar(max)", nullable: true),
CreatedBy = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
IsActive = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_LayoutVersions", x => x.Id);
table.ForeignKey(
name: "FK_LayoutVersions_Layouts_LayoutId",
column: x => x.LayoutId,
principalTable: "Layouts",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "LayoutLevels",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
VersionId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
LayoutLevelId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
LevelOrder = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_LayoutLevels", x => x.Id);
table.ForeignKey(
name: "FK_LayoutLevels_LayoutVersions_VersionId",
column: x => x.VersionId,
principalTable: "LayoutVersions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "LayoutLevelEditorSettings",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
LevelId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
EdgeMinLengthCreate = table.Column<double>(type: "float", nullable: false),
EdgeNameAutoGenerate = table.Column<bool>(type: "bit", nullable: false),
NodeNameAutoGenerate = table.Column<bool>(type: "bit", nullable: false),
NodeProximityRadius = table.Column<double>(type: "float", nullable: false),
OriginX = table.Column<double>(type: "float", nullable: false),
OriginY = table.Column<double>(type: "float", nullable: false),
Resolution = table.Column<double>(type: "float", nullable: false),
BoundsMinX = table.Column<double>(type: "float", nullable: true),
BoundsMaxX = table.Column<double>(type: "float", nullable: true),
BoundsMinY = table.Column<double>(type: "float", nullable: true),
BoundsMaxY = table.Column<double>(type: "float", nullable: true),
ImageWidth = table.Column<double>(type: "float", nullable: true),
ImageHeight = table.Column<double>(type: "float", nullable: true),
CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ModifiedDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_LayoutLevelEditorSettings", x => x.Id);
table.ForeignKey(
name: "FK_LayoutLevelEditorSettings_LayoutLevels_LevelId",
column: x => x.LevelId,
principalTable: "LayoutLevels",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Nodes",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
LevelId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
NodeId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
NodeName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
NodeDescription = table.Column<string>(type: "nvarchar(max)", nullable: true),
MapId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
X = table.Column<double>(type: "float", nullable: false),
Y = table.Column<double>(type: "float", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Nodes", x => x.Id);
table.ForeignKey(
name: "FK_Nodes_LayoutLevels_LevelId",
column: x => x.LevelId,
principalTable: "LayoutLevels",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Stations",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
LevelId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
StationId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
StationName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
StationDescription = table.Column<string>(type: "nvarchar(max)", nullable: true),
StationHeight = table.Column<double>(type: "float", nullable: true),
X = table.Column<double>(type: "float", nullable: false),
Y = table.Column<double>(type: "float", nullable: false),
Theta = table.Column<double>(type: "float", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Stations", x => x.Id);
table.ForeignKey(
name: "FK_Stations_LayoutLevels_LevelId",
column: x => x.LevelId,
principalTable: "LayoutLevels",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Edges",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
LevelId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
EdgeId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
StartNodeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
EndNodeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
EdgeName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
EdgeDescription = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Edges", x => x.Id);
table.CheckConstraint("CK_Edges_DifferentNodes", "[StartNodeId] <> [EndNodeId]");
table.ForeignKey(
name: "FK_Edges_LayoutLevels_LevelId",
column: x => x.LevelId,
principalTable: "LayoutLevels",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Edges_Nodes_EndNodeId",
column: x => x.EndNodeId,
principalTable: "Nodes",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Edges_Nodes_StartNodeId",
column: x => x.StartNodeId,
principalTable: "Nodes",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "NodeVehicleProperties",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
NodeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
VehicleTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Theta = table.Column<double>(type: "float", nullable: true),
Actions = table.Column<string>(type: "nvarchar(max)", nullable: true),
AllowedDeviationXY = table.Column<double>(type: "float", nullable: true),
AllowedDeviationTheta = table.Column<double>(type: "float", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_NodeVehicleProperties", x => x.Id);
table.ForeignKey(
name: "FK_NodeVehicleProperties_Nodes_NodeId",
column: x => x.NodeId,
principalTable: "Nodes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_NodeVehicleProperties_VehicleTypes_VehicleTypeId",
column: x => x.VehicleTypeId,
principalTable: "VehicleTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "StationInteractionNodes",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
StationId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
NodeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StationInteractionNodes", x => x.Id);
table.ForeignKey(
name: "FK_StationInteractionNodes_Nodes_NodeId",
column: x => x.NodeId,
principalTable: "Nodes",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_StationInteractionNodes_Stations_StationId",
column: x => x.StationId,
principalTable: "Stations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "EdgeVehicleProperties",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
EdgeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
VehicleTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
VehicleOrientation = table.Column<double>(type: "float", nullable: true),
OrientationType = table.Column<int>(type: "int", nullable: true),
RotationAllowed = table.Column<bool>(type: "bit", nullable: true),
RotationAtStartNodeAllowed = table.Column<int>(type: "int", nullable: true),
RotationAtEndNodeAllowed = table.Column<int>(type: "int", nullable: true),
MaxSpeed = table.Column<double>(type: "float", nullable: true),
MaxRotationSpeed = table.Column<double>(type: "float", nullable: true),
MinHeight = table.Column<double>(type: "float", nullable: true),
MaxHeight = table.Column<double>(type: "float", nullable: true),
LoadRestriction_Unloaded = table.Column<bool>(type: "bit", nullable: true),
LoadRestriction_Loaded = table.Column<bool>(type: "bit", nullable: true),
LoadRestriction_LoadSetNames = table.Column<string>(type: "nvarchar(max)", nullable: true),
TrajectoryDegree = table.Column<int>(type: "int", nullable: true),
TrajectoryControlPoint1X = table.Column<double>(type: "float", nullable: true),
TrajectoryControlPoint1Y = table.Column<double>(type: "float", nullable: true),
TrajectoryControlPoint2X = table.Column<double>(type: "float", nullable: true),
TrajectoryControlPoint2Y = table.Column<double>(type: "float", nullable: true),
Actions = table.Column<string>(type: "nvarchar(max)", nullable: true),
CorridorLeftWidth = table.Column<double>(type: "float", nullable: true),
CorridorRightWidth = table.Column<double>(type: "float", nullable: true),
CorridorRefPoint = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_EdgeVehicleProperties", x => x.Id);
table.ForeignKey(
name: "FK_EdgeVehicleProperties_Edges_EdgeId",
column: x => x.EdgeId,
principalTable: "Edges",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_EdgeVehicleProperties_VehicleTypes_VehicleTypeId",
column: x => x.VehicleTypeId,
principalTable: "VehicleTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Edges_EdgeId",
table: "Edges",
column: "EdgeId");
migrationBuilder.CreateIndex(
name: "IX_Edges_EndNodeId",
table: "Edges",
column: "EndNodeId");
migrationBuilder.CreateIndex(
name: "IX_Edges_LevelId_EdgeId",
table: "Edges",
columns: new[] { "LevelId", "EdgeId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Edges_StartNodeId",
table: "Edges",
column: "StartNodeId");
migrationBuilder.CreateIndex(
name: "IX_EdgeVehicleProperties_EdgeId",
table: "EdgeVehicleProperties",
column: "EdgeId");
migrationBuilder.CreateIndex(
name: "IX_EdgeVehicleProperties_EdgeId_VehicleTypeId",
table: "EdgeVehicleProperties",
columns: new[] { "EdgeId", "VehicleTypeId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_EdgeVehicleProperties_VehicleTypeId",
table: "EdgeVehicleProperties",
column: "VehicleTypeId");
migrationBuilder.CreateIndex(
name: "IX_LayoutLevelEditorSettings_LevelId",
table: "LayoutLevelEditorSettings",
column: "LevelId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_LayoutLevels_LevelOrder",
table: "LayoutLevels",
column: "LevelOrder");
migrationBuilder.CreateIndex(
name: "IX_LayoutLevels_VersionId_LayoutLevelId",
table: "LayoutLevels",
columns: new[] { "VersionId", "LayoutLevelId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Layouts_IsActive",
table: "Layouts",
column: "IsActive");
migrationBuilder.CreateIndex(
name: "IX_Layouts_LayoutId",
table: "Layouts",
column: "LayoutId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_LayoutVersions_IsActive",
table: "LayoutVersions",
column: "IsActive");
migrationBuilder.CreateIndex(
name: "IX_LayoutVersions_LayoutId_Version",
table: "LayoutVersions",
columns: new[] { "LayoutId", "Version" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Nodes_LevelId_NodeId",
table: "Nodes",
columns: new[] { "LevelId", "NodeId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Nodes_MapId",
table: "Nodes",
column: "MapId");
migrationBuilder.CreateIndex(
name: "IX_Nodes_NodeId",
table: "Nodes",
column: "NodeId");
migrationBuilder.CreateIndex(
name: "IX_Nodes_X_Y",
table: "Nodes",
columns: new[] { "X", "Y" });
migrationBuilder.CreateIndex(
name: "IX_NodeVehicleProperties_NodeId",
table: "NodeVehicleProperties",
column: "NodeId");
migrationBuilder.CreateIndex(
name: "IX_NodeVehicleProperties_NodeId_VehicleTypeId",
table: "NodeVehicleProperties",
columns: new[] { "NodeId", "VehicleTypeId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_NodeVehicleProperties_VehicleTypeId",
table: "NodeVehicleProperties",
column: "VehicleTypeId");
migrationBuilder.CreateIndex(
name: "IX_StationInteractionNodes_NodeId",
table: "StationInteractionNodes",
column: "NodeId");
migrationBuilder.CreateIndex(
name: "IX_StationInteractionNodes_StationId",
table: "StationInteractionNodes",
column: "StationId");
migrationBuilder.CreateIndex(
name: "IX_StationInteractionNodes_StationId_NodeId",
table: "StationInteractionNodes",
columns: new[] { "StationId", "NodeId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Stations_LevelId_StationId",
table: "Stations",
columns: new[] { "LevelId", "StationId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Stations_StationId",
table: "Stations",
column: "StationId");
migrationBuilder.CreateIndex(
name: "IX_VehicleTypes_IsActive",
table: "VehicleTypes",
column: "IsActive");
migrationBuilder.CreateIndex(
name: "IX_VehicleTypes_VehicleTypeId",
table: "VehicleTypes",
column: "VehicleTypeId",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "EdgeVehicleProperties");
migrationBuilder.DropTable(
name: "LayoutLevelEditorSettings");
migrationBuilder.DropTable(
name: "NodeVehicleProperties");
migrationBuilder.DropTable(
name: "StationInteractionNodes");
migrationBuilder.DropTable(
name: "Edges");
migrationBuilder.DropTable(
name: "VehicleTypes");
migrationBuilder.DropTable(
name: "Stations");
migrationBuilder.DropTable(
name: "Nodes");
migrationBuilder.DropTable(
name: "LayoutLevels");
migrationBuilder.DropTable(
name: "LayoutVersions");
migrationBuilder.DropTable(
name: "Layouts");
}
}
}

View File

@@ -0,0 +1,707 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet10.MapManager.Data;
#nullable disable
namespace RobotNet10.FleetManager.Data.Migrations.MapDb
{
[DbContext(typeof(MapDbContext))]
partial class MapDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("RobotNet10.MapManager.Data.Edge", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("EdgeDescription")
.HasColumnType("nvarchar(max)");
b.Property<string>("EdgeId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("EdgeName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<Guid>("EndNodeId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("LevelId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("StartNodeId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("EdgeId");
b.HasIndex("EndNodeId");
b.HasIndex("StartNodeId");
b.HasIndex("LevelId", "EdgeId")
.IsUnique();
b.ToTable("Edges", t =>
{
t.HasCheckConstraint("CK_Edges_DifferentNodes", "[StartNodeId] <> [EndNodeId]");
});
});
modelBuilder.Entity("RobotNet10.MapManager.Data.EdgeVehicleProperty", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Actions")
.HasColumnType("nvarchar(max)");
b.Property<double?>("CorridorLeftWidth")
.HasColumnType("float");
b.Property<int?>("CorridorRefPoint")
.HasColumnType("int");
b.Property<double?>("CorridorRightWidth")
.HasColumnType("float");
b.Property<Guid>("EdgeId")
.HasColumnType("uniqueidentifier");
b.Property<string>("LoadRestriction_LoadSetNames")
.HasColumnType("nvarchar(max)");
b.Property<bool?>("LoadRestriction_Loaded")
.HasColumnType("bit");
b.Property<bool?>("LoadRestriction_Unloaded")
.HasColumnType("bit");
b.Property<double?>("MaxHeight")
.HasColumnType("float");
b.Property<double?>("MaxRotationSpeed")
.HasColumnType("float");
b.Property<double?>("MaxSpeed")
.HasColumnType("float");
b.Property<double?>("MinHeight")
.HasColumnType("float");
b.Property<int?>("OrientationType")
.HasColumnType("int");
b.Property<bool?>("RotationAllowed")
.HasColumnType("bit");
b.Property<int?>("RotationAtEndNodeAllowed")
.HasColumnType("int");
b.Property<int?>("RotationAtStartNodeAllowed")
.HasColumnType("int");
b.Property<double?>("TrajectoryControlPoint1X")
.HasColumnType("float");
b.Property<double?>("TrajectoryControlPoint1Y")
.HasColumnType("float");
b.Property<double?>("TrajectoryControlPoint2X")
.HasColumnType("float");
b.Property<double?>("TrajectoryControlPoint2Y")
.HasColumnType("float");
b.Property<int?>("TrajectoryDegree")
.HasColumnType("int");
b.Property<double?>("VehicleOrientation")
.HasColumnType("float");
b.Property<Guid>("VehicleTypeId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("EdgeId");
b.HasIndex("VehicleTypeId");
b.HasIndex("EdgeId", "VehicleTypeId")
.IsUnique();
b.ToTable("EdgeVehicleProperties");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Layout", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedBy")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<string>("LayoutId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("LayoutName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("ModifiedBy")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<DateTime>("ModifiedDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("IsActive");
b.HasIndex("LayoutId")
.IsUnique();
b.ToTable("Layouts");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutLevel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("LayoutLevelId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int>("LevelOrder")
.HasColumnType("int");
b.Property<Guid>("VersionId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("LevelOrder");
b.HasIndex("VersionId", "LayoutLevelId")
.IsUnique();
b.ToTable("LayoutLevels");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutLevelEditorSettings", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<double?>("BoundsMaxX")
.HasColumnType("float");
b.Property<double?>("BoundsMaxY")
.HasColumnType("float");
b.Property<double?>("BoundsMinX")
.HasColumnType("float");
b.Property<double?>("BoundsMinY")
.HasColumnType("float");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<double>("EdgeMinLengthCreate")
.HasColumnType("float");
b.Property<bool>("EdgeNameAutoGenerate")
.HasColumnType("bit");
b.Property<double?>("ImageHeight")
.HasColumnType("float");
b.Property<double?>("ImageWidth")
.HasColumnType("float");
b.Property<Guid>("LevelId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("ModifiedDate")
.HasColumnType("datetime2");
b.Property<bool>("NodeNameAutoGenerate")
.HasColumnType("bit");
b.Property<double>("NodeProximityRadius")
.HasColumnType("float");
b.Property<double>("OriginX")
.HasColumnType("float");
b.Property<double>("OriginY")
.HasColumnType("float");
b.Property<double>("Resolution")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("LevelId")
.IsUnique();
b.ToTable("LayoutLevelEditorSettings");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("CreatedBy")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<string>("LayoutDescription")
.HasColumnType("nvarchar(max)");
b.Property<Guid>("LayoutId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.HasKey("Id");
b.HasIndex("IsActive");
b.HasIndex("LayoutId", "Version")
.IsUnique();
b.ToTable("LayoutVersions");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Node", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("LevelId")
.HasColumnType("uniqueidentifier");
b.Property<string>("MapId")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("NodeDescription")
.HasColumnType("nvarchar(max)");
b.Property<string>("NodeId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("NodeName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<double>("X")
.HasColumnType("float");
b.Property<double>("Y")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("MapId");
b.HasIndex("NodeId");
b.HasIndex("LevelId", "NodeId")
.IsUnique();
b.HasIndex("X", "Y");
b.ToTable("Nodes");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.NodeVehicleProperty", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Actions")
.HasColumnType("nvarchar(max)");
b.Property<double?>("AllowedDeviationTheta")
.HasColumnType("float");
b.Property<double?>("AllowedDeviationXY")
.HasColumnType("float");
b.Property<Guid>("NodeId")
.HasColumnType("uniqueidentifier");
b.Property<double?>("Theta")
.HasColumnType("float");
b.Property<Guid>("VehicleTypeId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("NodeId");
b.HasIndex("VehicleTypeId");
b.HasIndex("NodeId", "VehicleTypeId")
.IsUnique();
b.ToTable("NodeVehicleProperties");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Station", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("LevelId")
.HasColumnType("uniqueidentifier");
b.Property<string>("StationDescription")
.HasColumnType("nvarchar(max)");
b.Property<double?>("StationHeight")
.HasColumnType("float");
b.Property<string>("StationId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("StationName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<double?>("Theta")
.HasColumnType("float");
b.Property<double>("X")
.HasColumnType("float");
b.Property<double>("Y")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("StationId");
b.HasIndex("LevelId", "StationId")
.IsUnique();
b.ToTable("Stations");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.StationInteractionNode", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("NodeId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("StationId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("NodeId");
b.HasIndex("StationId");
b.HasIndex("StationId", "NodeId")
.IsUnique();
b.ToTable("StationInteractionNodes");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.VehicleType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Actions")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<string>("Specifications")
.HasColumnType("nvarchar(max)");
b.Property<string>("VehicleTypeId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("VehicleTypeName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("IsActive");
b.HasIndex("VehicleTypeId")
.IsUnique();
b.ToTable("VehicleTypes");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Edge", b =>
{
b.HasOne("RobotNet10.MapManager.Data.Node", "EndNode")
.WithMany("IncomingEdges")
.HasForeignKey("EndNodeId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("RobotNet10.MapManager.Data.LayoutLevel", "Level")
.WithMany("Edges")
.HasForeignKey("LevelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("RobotNet10.MapManager.Data.Node", "StartNode")
.WithMany("OutgoingEdges")
.HasForeignKey("StartNodeId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("EndNode");
b.Navigation("Level");
b.Navigation("StartNode");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.EdgeVehicleProperty", b =>
{
b.HasOne("RobotNet10.MapManager.Data.Edge", "Edge")
.WithMany("VehicleProperties")
.HasForeignKey("EdgeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("RobotNet10.MapManager.Data.VehicleType", "VehicleType")
.WithMany("EdgeVehicleProperties")
.HasForeignKey("VehicleTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Edge");
b.Navigation("VehicleType");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutLevel", b =>
{
b.HasOne("RobotNet10.MapManager.Data.LayoutVersion", "Version")
.WithMany("Levels")
.HasForeignKey("VersionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Version");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutLevelEditorSettings", b =>
{
b.HasOne("RobotNet10.MapManager.Data.LayoutLevel", "Level")
.WithOne("EditorSettings")
.HasForeignKey("RobotNet10.MapManager.Data.LayoutLevelEditorSettings", "LevelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Level");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutVersion", b =>
{
b.HasOne("RobotNet10.MapManager.Data.Layout", "Layout")
.WithMany("Versions")
.HasForeignKey("LayoutId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Layout");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Node", b =>
{
b.HasOne("RobotNet10.MapManager.Data.LayoutLevel", "Level")
.WithMany("Nodes")
.HasForeignKey("LevelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Level");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.NodeVehicleProperty", b =>
{
b.HasOne("RobotNet10.MapManager.Data.Node", "Node")
.WithMany("VehicleProperties")
.HasForeignKey("NodeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("RobotNet10.MapManager.Data.VehicleType", "VehicleType")
.WithMany("NodeVehicleProperties")
.HasForeignKey("VehicleTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Node");
b.Navigation("VehicleType");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Station", b =>
{
b.HasOne("RobotNet10.MapManager.Data.LayoutLevel", "Level")
.WithMany("Stations")
.HasForeignKey("LevelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Level");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.StationInteractionNode", b =>
{
b.HasOne("RobotNet10.MapManager.Data.Node", "Node")
.WithMany("StationInteractions")
.HasForeignKey("NodeId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("RobotNet10.MapManager.Data.Station", "Station")
.WithMany("InteractionNodes")
.HasForeignKey("StationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Node");
b.Navigation("Station");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Edge", b =>
{
b.Navigation("VehicleProperties");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Layout", b =>
{
b.Navigation("Versions");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutLevel", b =>
{
b.Navigation("Edges");
b.Navigation("EditorSettings");
b.Navigation("Nodes");
b.Navigation("Stations");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutVersion", b =>
{
b.Navigation("Levels");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Node", b =>
{
b.Navigation("IncomingEdges");
b.Navigation("OutgoingEdges");
b.Navigation("StationInteractions");
b.Navigation("VehicleProperties");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.Station", b =>
{
b.Navigation("InteractionNodes");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.VehicleType", b =>
{
b.Navigation("EdgeVehicleProperties");
b.Navigation("NodeVehicleProperties");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,77 @@
// <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 RobotNet10.ScriptEngine.Data;
#nullable disable
namespace RobotNet10.FleetManager.Data.Migrations.ScriptDb
{
[DbContext(typeof(ScriptEngineDbContext))]
[Migration("20260209025906_AddScriptDb")]
partial class AddScriptDb
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("RobotNet10.ScriptEngine.Data.InstanceMission", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Log")
.HasColumnType("nvarchar(max)")
.HasColumnName("Log");
b.Property<string>("MissionName")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("MissionName");
b.Property<string>("Parameters")
.HasColumnType("nvarchar(max)")
.HasColumnName("Parameters");
b.Property<int>("Score")
.HasColumnType("int")
.HasColumnName("Score");
b.Property<int>("State")
.HasColumnType("int")
.HasColumnName("State");
b.Property<DateTime>("StoppedAt")
.HasColumnType("datetime2")
.HasColumnName("StoppedAt");
b.Property<int>("TotalScore")
.HasColumnType("int")
.HasColumnName("TotalScore");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.ToTable("InstanceMissions");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,46 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RobotNet10.FleetManager.Data.Migrations.ScriptDb
{
/// <inheritdoc />
public partial class AddScriptDb : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "InstanceMissions",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
MissionName = table.Column<string>(type: "nvarchar(max)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
Parameters = table.Column<string>(type: "nvarchar(max)", nullable: true),
TotalScore = table.Column<int>(type: "int", nullable: false),
State = table.Column<int>(type: "int", nullable: false),
Score = table.Column<int>(type: "int", nullable: false),
StoppedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
Log = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_InstanceMissions", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_InstanceMissions_CreatedAt",
table: "InstanceMissions",
column: "CreatedAt");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "InstanceMissions");
}
}
}

View File

@@ -0,0 +1,74 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet10.ScriptEngine.Data;
#nullable disable
namespace RobotNet10.FleetManager.Data.Migrations.ScriptDb
{
[DbContext(typeof(ScriptEngineDbContext))]
partial class ScriptEngineDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("RobotNet10.ScriptEngine.Data.InstanceMission", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Log")
.HasColumnType("nvarchar(max)")
.HasColumnName("Log");
b.Property<string>("MissionName")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("MissionName");
b.Property<string>("Parameters")
.HasColumnType("nvarchar(max)")
.HasColumnName("Parameters");
b.Property<int>("Score")
.HasColumnType("int")
.HasColumnName("Score");
b.Property<int>("State")
.HasColumnType("int")
.HasColumnName("State");
b.Property<DateTime>("StoppedAt")
.HasColumnType("datetime2")
.HasColumnName("StoppedAt");
b.Property<int>("TotalScore")
.HasColumnType("int")
.HasColumnName("TotalScore");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.ToTable("InstanceMissions");
});
#pragma warning restore 612, 618
}
}
}