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,586 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet10.RobotApp.Data;
#nullable disable
namespace RobotNet10.RobotApp.Data.Migrations.AppDb
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20260129034352_AddAppDb")]
partial class AddAppDb
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("TEXT");
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("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
b.Property<string>("ProviderKey")
.HasColumnType("TEXT");
b.Property<string>("ProviderDisplayName")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("RoleId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<double>("Height")
.HasColumnType("double")
.HasColumnName("Height");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<double>("Length")
.HasColumnType("double")
.HasColumnName("Length");
b.Property<int>("NavigationType")
.HasColumnType("int")
.HasColumnName("NavigationType");
b.Property<double>("RadiusWheel")
.HasColumnType("double")
.HasColumnName("RadiusWheel");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.Property<double>("Width")
.HasColumnType("double")
.HasColumnName("Width");
b.HasKey("Id");
b.ToTable("RobotConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotPlcConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<string>("PLCAddress")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("PLCAddress");
b.Property<int>("PLCPort")
.HasColumnType("int")
.HasColumnName("PLCPort");
b.Property<byte>("PLCUnitId")
.HasColumnType("tinyint")
.HasColumnName("PLCUnitId");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.HasKey("Id");
b.ToTable("RobotPlcConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotSafetyConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<double>("SafetySpeedFast")
.HasColumnType("double")
.HasColumnName("SafetySpeedFast");
b.Property<double>("SafetySpeedMedium")
.HasColumnType("double")
.HasColumnName("SafetySpeedMedium");
b.Property<double>("SafetySpeedNormal")
.HasColumnType("double")
.HasColumnName("SafetySpeedNormal");
b.Property<double>("SafetySpeedOptimal")
.HasColumnType("double")
.HasColumnName("SafetySpeedOptimal");
b.Property<double>("SafetySpeedSlow")
.HasColumnType("double")
.HasColumnName("SafetySpeedSlow");
b.Property<double>("SafetySpeedVeryFast")
.HasColumnType("double")
.HasColumnName("SafetySpeedVeryFast");
b.Property<double>("SafetySpeedVerySlow")
.HasColumnType("double")
.HasColumnName("SafetySpeedVerySlow");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.HasKey("Id");
b.ToTable("RobotSafetyConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotSimulationConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("EnableSimulation")
.HasColumnType("bit")
.HasColumnName("EnableSimulation");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<double>("SimulationAcceleration")
.HasColumnType("double")
.HasColumnName("SimulationAcceleration");
b.Property<double>("SimulationDeceleration")
.HasColumnType("double")
.HasColumnName("SimulationDeceleration");
b.Property<double>("SimulationMaxAngularVelocity")
.HasColumnType("double")
.HasColumnName("SimulationMaxAngularVelocity");
b.Property<double>("SimulationMaxVelocity")
.HasColumnType("double")
.HasColumnName("SimulationMaxVelocity");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.HasKey("Id");
b.ToTable("RobotSimulationConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotVDA5050Config", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<string>("SerialNumber")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("SerialNumber");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.Property<string>("VDA5050CA")
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_CA");
b.Property<string>("VDA5050Cer")
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Cer");
b.Property<bool>("VDA5050EnablePassword")
.HasColumnType("bit")
.HasColumnName("VDA5050_EnablePassword");
b.Property<bool>("VDA5050EnableSSLSecure")
.HasColumnType("bit")
.HasColumnName("VDA5050_EnableSSLSecure");
b.Property<bool>("VDA5050EnableTls")
.HasColumnType("bit")
.HasColumnName("VDA5050_EnableTls");
b.Property<string>("VDA5050HostServer")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_HostServer");
b.Property<string>("VDA5050Key")
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Key");
b.Property<string>("VDA5050Manufacturer")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Manufacturer");
b.Property<string>("VDA5050Password")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Password");
b.Property<int>("VDA5050Port")
.HasColumnType("int")
.HasColumnName("VDA5050_Port");
b.Property<int>("VDA5050PublishRepeat")
.HasColumnType("int")
.HasColumnName("VDA5050_PublishRepeat");
b.Property<string>("VDA5050TopicPrefix")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_TopicPrefix");
b.Property<string>("VDA5050UserName")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_UserName");
b.Property<string>("VDA5050Version")
.HasMaxLength(20)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Version");
b.HasKey("Id");
b.ToTable("RobotVDA5050Config");
});
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.RobotApp.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("RobotNet10.RobotApp.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.RobotApp.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("RobotNet10.RobotApp.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,352 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RobotNet10.RobotApp.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: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetUsers",
columns: table => new
{
Id = table.Column<string>(type: "TEXT", nullable: false),
UserName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
Email = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(type: "INTEGER", nullable: false),
PasswordHash = table.Column<string>(type: "TEXT", nullable: true),
SecurityStamp = table.Column<string>(type: "TEXT", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true),
PhoneNumber = table.Column<string>(type: "TEXT", nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "INTEGER", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "TEXT", nullable: true),
LockoutEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
AccessFailedCount = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RobotConfig",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
NavigationType = table.Column<int>(type: "int", nullable: false),
RadiusWheel = table.Column<double>(type: "double", nullable: false),
Width = table.Column<double>(type: "double", nullable: false),
Length = table.Column<double>(type: "double", nullable: false),
Height = table.Column<double>(type: "double", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
IsActive = table.Column<bool>(type: "bit", nullable: false),
ConfigName = table.Column<string>(type: "nvarchar(64)", maxLength: 100, nullable: true),
Description = table.Column<string>(type: "ntext", maxLength: 500, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RobotConfig", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RobotPlcConfig",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
PLCAddress = table.Column<string>(type: "nvarchar(64)", maxLength: 50, nullable: true),
PLCPort = table.Column<int>(type: "int", nullable: false),
PLCUnitId = table.Column<byte>(type: "tinyint", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
IsActive = table.Column<bool>(type: "bit", nullable: false),
ConfigName = table.Column<string>(type: "nvarchar(64)", maxLength: 100, nullable: true),
Description = table.Column<string>(type: "ntext", maxLength: 500, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RobotPlcConfig", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RobotSafetyConfig",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
SafetySpeedVerySlow = table.Column<double>(type: "double", nullable: false),
SafetySpeedSlow = table.Column<double>(type: "double", nullable: false),
SafetySpeedNormal = table.Column<double>(type: "double", nullable: false),
SafetySpeedMedium = table.Column<double>(type: "double", nullable: false),
SafetySpeedOptimal = table.Column<double>(type: "double", nullable: false),
SafetySpeedFast = table.Column<double>(type: "double", nullable: false),
SafetySpeedVeryFast = table.Column<double>(type: "double", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
IsActive = table.Column<bool>(type: "bit", nullable: false),
ConfigName = table.Column<string>(type: "nvarchar(64)", maxLength: 100, nullable: true),
Description = table.Column<string>(type: "ntext", maxLength: 500, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RobotSafetyConfig", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RobotSimulationConfig",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
EnableSimulation = table.Column<bool>(type: "bit", nullable: false),
SimulationMaxVelocity = table.Column<double>(type: "double", nullable: false),
SimulationMaxAngularVelocity = table.Column<double>(type: "double", nullable: false),
SimulationAcceleration = table.Column<double>(type: "double", nullable: false),
SimulationDeceleration = table.Column<double>(type: "double", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
IsActive = table.Column<bool>(type: "bit", nullable: false),
ConfigName = table.Column<string>(type: "nvarchar(64)", maxLength: 100, nullable: true),
Description = table.Column<string>(type: "ntext", maxLength: 500, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RobotSimulationConfig", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RobotVDA5050Config",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
SerialNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 50, nullable: true),
VDA5050_TopicPrefix = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
VDA5050_Manufacturer = table.Column<string>(type: "nvarchar(64)", maxLength: 50, nullable: true),
VDA5050_Version = table.Column<string>(type: "nvarchar(64)", maxLength: 20, nullable: true),
VDA5050_HostServer = table.Column<string>(type: "nvarchar(64)", maxLength: 100, nullable: true),
VDA5050_Port = table.Column<int>(type: "int", nullable: false),
VDA5050_UserName = table.Column<string>(type: "nvarchar(64)", maxLength: 50, nullable: true),
VDA5050_Password = table.Column<string>(type: "nvarchar(64)", maxLength: 50, nullable: true),
VDA5050_PublishRepeat = table.Column<int>(type: "int", nullable: false),
VDA5050_EnablePassword = table.Column<bool>(type: "bit", nullable: false),
VDA5050_EnableTls = table.Column<bool>(type: "bit", nullable: false),
VDA5050_EnableSSLSecure = table.Column<bool>(type: "bit", nullable: false),
VDA5050_CA = table.Column<string>(type: "nvarchar(64)", nullable: true),
VDA5050_Cer = table.Column<string>(type: "nvarchar(64)", nullable: true),
VDA5050_Key = table.Column<string>(type: "nvarchar(64)", nullable: true),
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
IsActive = table.Column<bool>(type: "bit", nullable: false),
ConfigName = table.Column<string>(type: "nvarchar(64)", maxLength: 100, nullable: true),
Description = table.Column<string>(type: "ntext", maxLength: 500, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RobotVDA5050Config", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetRoleClaims",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
RoleId = table.Column<string>(type: "TEXT", nullable: false),
ClaimType = table.Column<string>(type: "TEXT", nullable: true),
ClaimValue = table.Column<string>(type: "TEXT", 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: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
UserId = table.Column<string>(type: "TEXT", nullable: false),
ClaimType = table.Column<string>(type: "TEXT", nullable: true),
ClaimValue = table.Column<string>(type: "TEXT", 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: "TEXT", nullable: false),
ProviderKey = table.Column<string>(type: "TEXT", nullable: false),
ProviderDisplayName = table.Column<string>(type: "TEXT", nullable: true),
UserId = table.Column<string>(type: "TEXT", 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: "TEXT", nullable: false),
RoleId = table.Column<string>(type: "TEXT", 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: "TEXT", nullable: false),
LoginProvider = table.Column<string>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
Value = table.Column<string>(type: "TEXT", 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.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId",
table: "AspNetRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true);
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);
}
/// <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: "RobotConfig");
migrationBuilder.DropTable(
name: "RobotPlcConfig");
migrationBuilder.DropTable(
name: "RobotSafetyConfig");
migrationBuilder.DropTable(
name: "RobotSimulationConfig");
migrationBuilder.DropTable(
name: "RobotVDA5050Config");
migrationBuilder.DropTable(
name: "AspNetRoles");
migrationBuilder.DropTable(
name: "AspNetUsers");
}
}
}

View File

@@ -0,0 +1,711 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet10.RobotApp.Data;
#nullable disable
namespace RobotNet10.RobotApp.Data.Migrations.AppDb
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20260226030442_AddDockStationConfig")]
partial class AddDockStationConfig
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("TEXT");
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("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
b.Property<string>("ProviderKey")
.HasColumnType("TEXT");
b.Property<string>("ProviderDisplayName")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("RoleId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.DockStationConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<double>("Length")
.HasColumnType("double")
.HasColumnName("Length");
b.Property<string>("StationId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("StationId");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.Property<double>("Width")
.HasColumnType("double")
.HasColumnName("Width");
b.Property<double>("X")
.HasColumnType("double")
.HasColumnName("X");
b.Property<double>("Y")
.HasColumnType("double")
.HasColumnName("Y");
b.Property<double>("Yaw")
.HasColumnType("double")
.HasColumnName("Yaw");
b.HasKey("Id");
b.HasIndex("StationId")
.IsUnique();
b.ToTable("DockStationConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.DockStationMarkerEntry", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("Code")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("Code");
b.Property<string>("DeviceId")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("DeviceId");
b.Property<Guid>("DockStationConfigId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DockStationConfigId");
b.Property<string>("MarkerId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("MarkerId");
b.Property<int>("Priority")
.HasColumnType("int")
.HasColumnName("Priority");
b.Property<string>("ReferencePointsJson")
.HasColumnType("ntext")
.HasColumnName("ReferencePointsJson");
b.Property<int>("Type")
.HasColumnType("int")
.HasColumnName("Type");
b.HasKey("Id");
b.HasIndex("DockStationConfigId");
b.ToTable("DockStationMarkerEntry");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<double>("Height")
.HasColumnType("double")
.HasColumnName("Height");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<double>("Length")
.HasColumnType("double")
.HasColumnName("Length");
b.Property<int>("NavigationType")
.HasColumnType("int")
.HasColumnName("NavigationType");
b.Property<double>("RadiusWheel")
.HasColumnType("double")
.HasColumnName("RadiusWheel");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.Property<double>("Width")
.HasColumnType("double")
.HasColumnName("Width");
b.HasKey("Id");
b.ToTable("RobotConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotPlcConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<string>("PLCAddress")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("PLCAddress");
b.Property<int>("PLCPort")
.HasColumnType("int")
.HasColumnName("PLCPort");
b.Property<byte>("PLCUnitId")
.HasColumnType("tinyint")
.HasColumnName("PLCUnitId");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.HasKey("Id");
b.ToTable("RobotPlcConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotSafetyConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<double>("SafetySpeedFast")
.HasColumnType("double")
.HasColumnName("SafetySpeedFast");
b.Property<double>("SafetySpeedMedium")
.HasColumnType("double")
.HasColumnName("SafetySpeedMedium");
b.Property<double>("SafetySpeedNormal")
.HasColumnType("double")
.HasColumnName("SafetySpeedNormal");
b.Property<double>("SafetySpeedOptimal")
.HasColumnType("double")
.HasColumnName("SafetySpeedOptimal");
b.Property<double>("SafetySpeedSlow")
.HasColumnType("double")
.HasColumnName("SafetySpeedSlow");
b.Property<double>("SafetySpeedVeryFast")
.HasColumnType("double")
.HasColumnName("SafetySpeedVeryFast");
b.Property<double>("SafetySpeedVerySlow")
.HasColumnType("double")
.HasColumnName("SafetySpeedVerySlow");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.HasKey("Id");
b.ToTable("RobotSafetyConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotSimulationConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("EnableSimulation")
.HasColumnType("bit")
.HasColumnName("EnableSimulation");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<double>("SimulationAcceleration")
.HasColumnType("double")
.HasColumnName("SimulationAcceleration");
b.Property<double>("SimulationDeceleration")
.HasColumnType("double")
.HasColumnName("SimulationDeceleration");
b.Property<double>("SimulationMaxAngularVelocity")
.HasColumnType("double")
.HasColumnName("SimulationMaxAngularVelocity");
b.Property<double>("SimulationMaxVelocity")
.HasColumnType("double")
.HasColumnName("SimulationMaxVelocity");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.HasKey("Id");
b.ToTable("RobotSimulationConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotVDA5050Config", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<string>("SerialNumber")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("SerialNumber");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.Property<string>("VDA5050CA")
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_CA");
b.Property<string>("VDA5050Cer")
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Cer");
b.Property<bool>("VDA5050EnablePassword")
.HasColumnType("bit")
.HasColumnName("VDA5050_EnablePassword");
b.Property<bool>("VDA5050EnableSSLSecure")
.HasColumnType("bit")
.HasColumnName("VDA5050_EnableSSLSecure");
b.Property<bool>("VDA5050EnableTls")
.HasColumnType("bit")
.HasColumnName("VDA5050_EnableTls");
b.Property<string>("VDA5050HostServer")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_HostServer");
b.Property<string>("VDA5050Key")
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Key");
b.Property<string>("VDA5050Manufacturer")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Manufacturer");
b.Property<string>("VDA5050Password")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Password");
b.Property<int>("VDA5050Port")
.HasColumnType("int")
.HasColumnName("VDA5050_Port");
b.Property<int>("VDA5050PublishRepeat")
.HasColumnType("int")
.HasColumnName("VDA5050_PublishRepeat");
b.Property<string>("VDA5050TopicPrefix")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_TopicPrefix");
b.Property<string>("VDA5050UserName")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_UserName");
b.Property<string>("VDA5050Version")
.HasMaxLength(20)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Version");
b.HasKey("Id");
b.ToTable("RobotVDA5050Config");
});
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.RobotApp.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("RobotNet10.RobotApp.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.RobotApp.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("RobotNet10.RobotApp.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.DockStationMarkerEntry", b =>
{
b.HasOne("RobotNet10.RobotApp.Data.DockStationConfig", "DockStationConfig")
.WithMany("MarkerEntries")
.HasForeignKey("DockStationConfigId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DockStationConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.DockStationConfig", b =>
{
b.Navigation("MarkerEntries");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,82 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RobotNet10.RobotApp.Data.Migrations.AppDb
{
/// <inheritdoc />
public partial class AddDockStationConfig : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DockStationConfig",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
StationId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
ConfigName = table.Column<string>(type: "nvarchar(64)", maxLength: 100, nullable: true),
Description = table.Column<string>(type: "ntext", maxLength: 500, nullable: true),
X = table.Column<double>(type: "double", nullable: false),
Y = table.Column<double>(type: "double", nullable: false),
Yaw = table.Column<double>(type: "double", nullable: false),
Width = table.Column<double>(type: "double", nullable: false),
Length = table.Column<double>(type: "double", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
IsActive = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DockStationConfig", x => x.Id);
});
migrationBuilder.CreateTable(
name: "DockStationMarkerEntry",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
DockStationConfigId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
MarkerId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Type = table.Column<int>(type: "int", nullable: false),
Priority = table.Column<int>(type: "int", nullable: false),
DeviceId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
Code = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
ReferencePointsJson = table.Column<string>(type: "ntext", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DockStationMarkerEntry", x => x.Id);
table.ForeignKey(
name: "FK_DockStationMarkerEntry_DockStationConfig_DockStationConfigId",
column: x => x.DockStationConfigId,
principalTable: "DockStationConfig",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_DockStationConfig_StationId",
table: "DockStationConfig",
column: "StationId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_DockStationMarkerEntry_DockStationConfigId",
table: "DockStationMarkerEntry",
column: "DockStationConfigId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DockStationMarkerEntry");
migrationBuilder.DropTable(
name: "DockStationConfig");
}
}
}

View File

@@ -0,0 +1,708 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet10.RobotApp.Data;
#nullable disable
namespace RobotNet10.RobotApp.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");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("TEXT");
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("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
b.Property<string>("ProviderKey")
.HasColumnType("TEXT");
b.Property<string>("ProviderDisplayName")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("RoleId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.DockStationConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<double>("Length")
.HasColumnType("double")
.HasColumnName("Length");
b.Property<string>("StationId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("StationId");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.Property<double>("Width")
.HasColumnType("double")
.HasColumnName("Width");
b.Property<double>("X")
.HasColumnType("double")
.HasColumnName("X");
b.Property<double>("Y")
.HasColumnType("double")
.HasColumnName("Y");
b.Property<double>("Yaw")
.HasColumnType("double")
.HasColumnName("Yaw");
b.HasKey("Id");
b.HasIndex("StationId")
.IsUnique();
b.ToTable("DockStationConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.DockStationMarkerEntry", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("Code")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("Code");
b.Property<string>("DeviceId")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("DeviceId");
b.Property<Guid>("DockStationConfigId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DockStationConfigId");
b.Property<string>("MarkerId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("MarkerId");
b.Property<int>("Priority")
.HasColumnType("int")
.HasColumnName("Priority");
b.Property<string>("ReferencePointsJson")
.HasColumnType("ntext")
.HasColumnName("ReferencePointsJson");
b.Property<int>("Type")
.HasColumnType("int")
.HasColumnName("Type");
b.HasKey("Id");
b.HasIndex("DockStationConfigId");
b.ToTable("DockStationMarkerEntry");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<double>("Height")
.HasColumnType("double")
.HasColumnName("Height");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<double>("Length")
.HasColumnType("double")
.HasColumnName("Length");
b.Property<int>("NavigationType")
.HasColumnType("int")
.HasColumnName("NavigationType");
b.Property<double>("RadiusWheel")
.HasColumnType("double")
.HasColumnName("RadiusWheel");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.Property<double>("Width")
.HasColumnType("double")
.HasColumnName("Width");
b.HasKey("Id");
b.ToTable("RobotConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotPlcConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<string>("PLCAddress")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("PLCAddress");
b.Property<int>("PLCPort")
.HasColumnType("int")
.HasColumnName("PLCPort");
b.Property<byte>("PLCUnitId")
.HasColumnType("tinyint")
.HasColumnName("PLCUnitId");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.HasKey("Id");
b.ToTable("RobotPlcConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotSafetyConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<double>("SafetySpeedFast")
.HasColumnType("double")
.HasColumnName("SafetySpeedFast");
b.Property<double>("SafetySpeedMedium")
.HasColumnType("double")
.HasColumnName("SafetySpeedMedium");
b.Property<double>("SafetySpeedNormal")
.HasColumnType("double")
.HasColumnName("SafetySpeedNormal");
b.Property<double>("SafetySpeedOptimal")
.HasColumnType("double")
.HasColumnName("SafetySpeedOptimal");
b.Property<double>("SafetySpeedSlow")
.HasColumnType("double")
.HasColumnName("SafetySpeedSlow");
b.Property<double>("SafetySpeedVeryFast")
.HasColumnType("double")
.HasColumnName("SafetySpeedVeryFast");
b.Property<double>("SafetySpeedVerySlow")
.HasColumnType("double")
.HasColumnName("SafetySpeedVerySlow");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.HasKey("Id");
b.ToTable("RobotSafetyConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotSimulationConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("EnableSimulation")
.HasColumnType("bit")
.HasColumnName("EnableSimulation");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<double>("SimulationAcceleration")
.HasColumnType("double")
.HasColumnName("SimulationAcceleration");
b.Property<double>("SimulationDeceleration")
.HasColumnType("double")
.HasColumnName("SimulationDeceleration");
b.Property<double>("SimulationMaxAngularVelocity")
.HasColumnType("double")
.HasColumnName("SimulationMaxAngularVelocity");
b.Property<double>("SimulationMaxVelocity")
.HasColumnType("double")
.HasColumnName("SimulationMaxVelocity");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.HasKey("Id");
b.ToTable("RobotSimulationConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.RobotVDA5050Config", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnName("Id");
b.Property<string>("ConfigName")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("ConfigName");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2")
.HasColumnName("CreatedAt");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("ntext")
.HasColumnName("Description");
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<string>("SerialNumber")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("SerialNumber");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2")
.HasColumnName("UpdatedAt");
b.Property<string>("VDA5050CA")
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_CA");
b.Property<string>("VDA5050Cer")
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Cer");
b.Property<bool>("VDA5050EnablePassword")
.HasColumnType("bit")
.HasColumnName("VDA5050_EnablePassword");
b.Property<bool>("VDA5050EnableSSLSecure")
.HasColumnType("bit")
.HasColumnName("VDA5050_EnableSSLSecure");
b.Property<bool>("VDA5050EnableTls")
.HasColumnType("bit")
.HasColumnName("VDA5050_EnableTls");
b.Property<string>("VDA5050HostServer")
.HasMaxLength(100)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_HostServer");
b.Property<string>("VDA5050Key")
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Key");
b.Property<string>("VDA5050Manufacturer")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Manufacturer");
b.Property<string>("VDA5050Password")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Password");
b.Property<int>("VDA5050Port")
.HasColumnType("int")
.HasColumnName("VDA5050_Port");
b.Property<int>("VDA5050PublishRepeat")
.HasColumnType("int")
.HasColumnName("VDA5050_PublishRepeat");
b.Property<string>("VDA5050TopicPrefix")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_TopicPrefix");
b.Property<string>("VDA5050UserName")
.HasMaxLength(50)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_UserName");
b.Property<string>("VDA5050Version")
.HasMaxLength(20)
.HasColumnType("nvarchar(64)")
.HasColumnName("VDA5050_Version");
b.HasKey("Id");
b.ToTable("RobotVDA5050Config");
});
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.RobotApp.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("RobotNet10.RobotApp.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.RobotApp.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("RobotNet10.RobotApp.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.DockStationMarkerEntry", b =>
{
b.HasOne("RobotNet10.RobotApp.Data.DockStationConfig", "DockStationConfig")
.WithMany("MarkerEntries")
.HasForeignKey("DockStationConfigId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DockStationConfig");
});
modelBuilder.Entity("RobotNet10.RobotApp.Data.DockStationConfig", b =>
{
b.Navigation("MarkerEntries");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,705 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet10.MapManager.Data;
#nullable disable
namespace RobotNet10.RobotApp.Data.Migrations.MapDb
{
[DbContext(typeof(MapDbContext))]
[Migration("20260305070456_AddMapDb")]
partial class AddMapDb
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.3");
modelBuilder.Entity("RobotNet10.MapManager.Data.Edge", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("EdgeDescription")
.HasColumnType("TEXT");
b.Property<string>("EdgeId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("EdgeName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<Guid>("EndNodeId")
.HasColumnType("TEXT");
b.Property<Guid>("LevelId")
.HasColumnType("TEXT");
b.Property<Guid>("StartNodeId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("Actions")
.HasColumnType("TEXT");
b.Property<double?>("CorridorLeftWidth")
.HasColumnType("REAL");
b.Property<int?>("CorridorRefPoint")
.HasColumnType("INTEGER");
b.Property<double?>("CorridorRightWidth")
.HasColumnType("REAL");
b.Property<Guid>("EdgeId")
.HasColumnType("TEXT");
b.Property<string>("LoadRestriction_LoadSetNames")
.HasColumnType("TEXT");
b.Property<bool?>("LoadRestriction_Loaded")
.HasColumnType("INTEGER");
b.Property<bool?>("LoadRestriction_Unloaded")
.HasColumnType("INTEGER");
b.Property<double?>("MaxHeight")
.HasColumnType("REAL");
b.Property<double?>("MaxRotationSpeed")
.HasColumnType("REAL");
b.Property<double?>("MaxSpeed")
.HasColumnType("REAL");
b.Property<double?>("MinHeight")
.HasColumnType("REAL");
b.Property<int?>("OrientationType")
.HasColumnType("INTEGER");
b.Property<bool?>("RotationAllowed")
.HasColumnType("INTEGER");
b.Property<int?>("RotationAtEndNodeAllowed")
.HasColumnType("INTEGER");
b.Property<int?>("RotationAtStartNodeAllowed")
.HasColumnType("INTEGER");
b.Property<double?>("TrajectoryControlPoint1X")
.HasColumnType("REAL");
b.Property<double?>("TrajectoryControlPoint1Y")
.HasColumnType("REAL");
b.Property<double?>("TrajectoryControlPoint2X")
.HasColumnType("REAL");
b.Property<double?>("TrajectoryControlPoint2Y")
.HasColumnType("REAL");
b.Property<int?>("TrajectoryDegree")
.HasColumnType("INTEGER");
b.Property<double?>("VehicleOrientation")
.HasColumnType("REAL");
b.Property<Guid>("VehicleTypeId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("CreatedBy")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedDate")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<bool>("IsActive")
.HasColumnType("INTEGER");
b.Property<string>("LayoutId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("LayoutName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("ModifiedBy")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<DateTime>("ModifiedDate")
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("LayoutLevelId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<int>("LevelOrder")
.HasColumnType("INTEGER");
b.Property<Guid>("VersionId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<double?>("BoundsMaxX")
.HasColumnType("REAL");
b.Property<double?>("BoundsMaxY")
.HasColumnType("REAL");
b.Property<double?>("BoundsMinX")
.HasColumnType("REAL");
b.Property<double?>("BoundsMinY")
.HasColumnType("REAL");
b.Property<DateTime>("CreatedDate")
.HasColumnType("TEXT");
b.Property<double>("EdgeMinLengthCreate")
.HasColumnType("REAL");
b.Property<bool>("EdgeNameAutoGenerate")
.HasColumnType("INTEGER");
b.Property<double?>("ImageHeight")
.HasColumnType("REAL");
b.Property<double?>("ImageWidth")
.HasColumnType("REAL");
b.Property<Guid>("LevelId")
.HasColumnType("TEXT");
b.Property<DateTime>("ModifiedDate")
.HasColumnType("TEXT");
b.Property<bool>("NodeNameAutoGenerate")
.HasColumnType("INTEGER");
b.Property<double>("NodeProximityRadius")
.HasColumnType("REAL");
b.Property<double>("OriginX")
.HasColumnType("REAL");
b.Property<double>("OriginY")
.HasColumnType("REAL");
b.Property<double>("Resolution")
.HasColumnType("REAL");
b.HasKey("Id");
b.HasIndex("LevelId")
.IsUnique();
b.ToTable("LayoutLevelEditorSettings");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreatedBy")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedDate")
.HasColumnType("TEXT");
b.Property<bool>("IsActive")
.HasColumnType("INTEGER");
b.Property<string>("LayoutDescription")
.HasColumnType("TEXT");
b.Property<Guid>("LayoutId")
.HasColumnType("TEXT");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
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("TEXT");
b.Property<Guid>("LevelId")
.HasColumnType("TEXT");
b.Property<string>("MapId")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("NodeDescription")
.HasColumnType("TEXT");
b.Property<string>("NodeId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("NodeName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<double>("X")
.HasColumnType("REAL");
b.Property<double>("Y")
.HasColumnType("REAL");
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("TEXT");
b.Property<string>("Actions")
.HasColumnType("TEXT");
b.Property<double?>("AllowedDeviationTheta")
.HasColumnType("REAL");
b.Property<double?>("AllowedDeviationXY")
.HasColumnType("REAL");
b.Property<Guid>("NodeId")
.HasColumnType("TEXT");
b.Property<double?>("Theta")
.HasColumnType("REAL");
b.Property<Guid>("VehicleTypeId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<Guid>("LevelId")
.HasColumnType("TEXT");
b.Property<string>("StationDescription")
.HasColumnType("TEXT");
b.Property<double?>("StationHeight")
.HasColumnType("REAL");
b.Property<string>("StationId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("StationName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<double?>("Theta")
.HasColumnType("REAL");
b.Property<double>("X")
.HasColumnType("REAL");
b.Property<double>("Y")
.HasColumnType("REAL");
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("TEXT");
b.Property<Guid>("NodeId")
.HasColumnType("TEXT");
b.Property<Guid>("StationId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("Actions")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedDate")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<bool>("IsActive")
.HasColumnType("INTEGER");
b.Property<string>("Specifications")
.HasColumnType("TEXT");
b.Property<string>("VehicleTypeId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<string>("VehicleTypeName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
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.RobotApp.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: "TEXT", nullable: false),
LayoutId = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
LayoutName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: true),
IsActive = table.Column<bool>(type: "INTEGER", nullable: false),
CreatedDate = table.Column<DateTime>(type: "TEXT", nullable: false),
ModifiedDate = table.Column<DateTime>(type: "TEXT", nullable: false),
CreatedBy = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
ModifiedBy = table.Column<string>(type: "TEXT", 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: "TEXT", nullable: false),
VehicleTypeId = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
VehicleTypeName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: true),
Specifications = table.Column<string>(type: "TEXT", nullable: true),
IsActive = table.Column<bool>(type: "INTEGER", nullable: false),
Actions = table.Column<string>(type: "TEXT", nullable: true),
CreatedDate = table.Column<DateTime>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_VehicleTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "LayoutVersions",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
LayoutId = table.Column<Guid>(type: "TEXT", nullable: false),
Version = table.Column<string>(type: "TEXT", maxLength: 32, nullable: false),
LayoutDescription = table.Column<string>(type: "TEXT", nullable: true),
CreatedBy = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
CreatedDate = table.Column<DateTime>(type: "TEXT", nullable: false),
IsActive = table.Column<bool>(type: "INTEGER", 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: "TEXT", nullable: false),
VersionId = table.Column<Guid>(type: "TEXT", nullable: false),
LayoutLevelId = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
LevelOrder = table.Column<int>(type: "INTEGER", 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: "TEXT", nullable: false),
LevelId = table.Column<Guid>(type: "TEXT", nullable: false),
EdgeMinLengthCreate = table.Column<double>(type: "REAL", nullable: false),
EdgeNameAutoGenerate = table.Column<bool>(type: "INTEGER", nullable: false),
NodeNameAutoGenerate = table.Column<bool>(type: "INTEGER", nullable: false),
NodeProximityRadius = table.Column<double>(type: "REAL", nullable: false),
OriginX = table.Column<double>(type: "REAL", nullable: false),
OriginY = table.Column<double>(type: "REAL", nullable: false),
Resolution = table.Column<double>(type: "REAL", nullable: false),
BoundsMinX = table.Column<double>(type: "REAL", nullable: true),
BoundsMaxX = table.Column<double>(type: "REAL", nullable: true),
BoundsMinY = table.Column<double>(type: "REAL", nullable: true),
BoundsMaxY = table.Column<double>(type: "REAL", nullable: true),
ImageWidth = table.Column<double>(type: "REAL", nullable: true),
ImageHeight = table.Column<double>(type: "REAL", nullable: true),
CreatedDate = table.Column<DateTime>(type: "TEXT", nullable: false),
ModifiedDate = table.Column<DateTime>(type: "TEXT", 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: "TEXT", nullable: false),
LevelId = table.Column<Guid>(type: "TEXT", nullable: false),
NodeId = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
NodeName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NodeDescription = table.Column<string>(type: "TEXT", nullable: true),
MapId = table.Column<string>(type: "TEXT", maxLength: 128, nullable: true),
X = table.Column<double>(type: "REAL", nullable: false),
Y = table.Column<double>(type: "REAL", 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: "TEXT", nullable: false),
LevelId = table.Column<Guid>(type: "TEXT", nullable: false),
StationId = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
StationName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
StationDescription = table.Column<string>(type: "TEXT", nullable: true),
StationHeight = table.Column<double>(type: "REAL", nullable: true),
X = table.Column<double>(type: "REAL", nullable: false),
Y = table.Column<double>(type: "REAL", nullable: false),
Theta = table.Column<double>(type: "REAL", 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: "TEXT", nullable: false),
LevelId = table.Column<Guid>(type: "TEXT", nullable: false),
EdgeId = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
StartNodeId = table.Column<Guid>(type: "TEXT", nullable: false),
EndNodeId = table.Column<Guid>(type: "TEXT", nullable: false),
EdgeName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
EdgeDescription = table.Column<string>(type: "TEXT", 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: "TEXT", nullable: false),
NodeId = table.Column<Guid>(type: "TEXT", nullable: false),
VehicleTypeId = table.Column<Guid>(type: "TEXT", nullable: false),
Theta = table.Column<double>(type: "REAL", nullable: true),
Actions = table.Column<string>(type: "TEXT", nullable: true),
AllowedDeviationXY = table.Column<double>(type: "REAL", nullable: true),
AllowedDeviationTheta = table.Column<double>(type: "REAL", 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: "TEXT", nullable: false),
StationId = table.Column<Guid>(type: "TEXT", nullable: false),
NodeId = table.Column<Guid>(type: "TEXT", 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: "TEXT", nullable: false),
EdgeId = table.Column<Guid>(type: "TEXT", nullable: false),
VehicleTypeId = table.Column<Guid>(type: "TEXT", nullable: false),
VehicleOrientation = table.Column<double>(type: "REAL", nullable: true),
OrientationType = table.Column<int>(type: "INTEGER", nullable: true),
RotationAllowed = table.Column<bool>(type: "INTEGER", nullable: true),
RotationAtStartNodeAllowed = table.Column<int>(type: "INTEGER", nullable: true),
RotationAtEndNodeAllowed = table.Column<int>(type: "INTEGER", nullable: true),
MaxSpeed = table.Column<double>(type: "REAL", nullable: true),
MaxRotationSpeed = table.Column<double>(type: "REAL", nullable: true),
MinHeight = table.Column<double>(type: "REAL", nullable: true),
MaxHeight = table.Column<double>(type: "REAL", nullable: true),
LoadRestriction_Unloaded = table.Column<bool>(type: "INTEGER", nullable: true),
LoadRestriction_Loaded = table.Column<bool>(type: "INTEGER", nullable: true),
LoadRestriction_LoadSetNames = table.Column<string>(type: "TEXT", nullable: true),
TrajectoryDegree = table.Column<int>(type: "INTEGER", nullable: true),
TrajectoryControlPoint1X = table.Column<double>(type: "REAL", nullable: true),
TrajectoryControlPoint1Y = table.Column<double>(type: "REAL", nullable: true),
TrajectoryControlPoint2X = table.Column<double>(type: "REAL", nullable: true),
TrajectoryControlPoint2Y = table.Column<double>(type: "REAL", nullable: true),
Actions = table.Column<string>(type: "TEXT", nullable: true),
CorridorLeftWidth = table.Column<double>(type: "REAL", nullable: true),
CorridorRightWidth = table.Column<double>(type: "REAL", nullable: true),
CorridorRefPoint = table.Column<int>(type: "INTEGER", 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,702 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet10.MapManager.Data;
#nullable disable
namespace RobotNet10.RobotApp.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");
modelBuilder.Entity("RobotNet10.MapManager.Data.Edge", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("EdgeDescription")
.HasColumnType("TEXT");
b.Property<string>("EdgeId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("EdgeName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<Guid>("EndNodeId")
.HasColumnType("TEXT");
b.Property<Guid>("LevelId")
.HasColumnType("TEXT");
b.Property<Guid>("StartNodeId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("Actions")
.HasColumnType("TEXT");
b.Property<double?>("CorridorLeftWidth")
.HasColumnType("REAL");
b.Property<int?>("CorridorRefPoint")
.HasColumnType("INTEGER");
b.Property<double?>("CorridorRightWidth")
.HasColumnType("REAL");
b.Property<Guid>("EdgeId")
.HasColumnType("TEXT");
b.Property<string>("LoadRestriction_LoadSetNames")
.HasColumnType("TEXT");
b.Property<bool?>("LoadRestriction_Loaded")
.HasColumnType("INTEGER");
b.Property<bool?>("LoadRestriction_Unloaded")
.HasColumnType("INTEGER");
b.Property<double?>("MaxHeight")
.HasColumnType("REAL");
b.Property<double?>("MaxRotationSpeed")
.HasColumnType("REAL");
b.Property<double?>("MaxSpeed")
.HasColumnType("REAL");
b.Property<double?>("MinHeight")
.HasColumnType("REAL");
b.Property<int?>("OrientationType")
.HasColumnType("INTEGER");
b.Property<bool?>("RotationAllowed")
.HasColumnType("INTEGER");
b.Property<int?>("RotationAtEndNodeAllowed")
.HasColumnType("INTEGER");
b.Property<int?>("RotationAtStartNodeAllowed")
.HasColumnType("INTEGER");
b.Property<double?>("TrajectoryControlPoint1X")
.HasColumnType("REAL");
b.Property<double?>("TrajectoryControlPoint1Y")
.HasColumnType("REAL");
b.Property<double?>("TrajectoryControlPoint2X")
.HasColumnType("REAL");
b.Property<double?>("TrajectoryControlPoint2Y")
.HasColumnType("REAL");
b.Property<int?>("TrajectoryDegree")
.HasColumnType("INTEGER");
b.Property<double?>("VehicleOrientation")
.HasColumnType("REAL");
b.Property<Guid>("VehicleTypeId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("CreatedBy")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedDate")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<bool>("IsActive")
.HasColumnType("INTEGER");
b.Property<string>("LayoutId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("LayoutName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("ModifiedBy")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<DateTime>("ModifiedDate")
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("LayoutLevelId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<int>("LevelOrder")
.HasColumnType("INTEGER");
b.Property<Guid>("VersionId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<double?>("BoundsMaxX")
.HasColumnType("REAL");
b.Property<double?>("BoundsMaxY")
.HasColumnType("REAL");
b.Property<double?>("BoundsMinX")
.HasColumnType("REAL");
b.Property<double?>("BoundsMinY")
.HasColumnType("REAL");
b.Property<DateTime>("CreatedDate")
.HasColumnType("TEXT");
b.Property<double>("EdgeMinLengthCreate")
.HasColumnType("REAL");
b.Property<bool>("EdgeNameAutoGenerate")
.HasColumnType("INTEGER");
b.Property<double?>("ImageHeight")
.HasColumnType("REAL");
b.Property<double?>("ImageWidth")
.HasColumnType("REAL");
b.Property<Guid>("LevelId")
.HasColumnType("TEXT");
b.Property<DateTime>("ModifiedDate")
.HasColumnType("TEXT");
b.Property<bool>("NodeNameAutoGenerate")
.HasColumnType("INTEGER");
b.Property<double>("NodeProximityRadius")
.HasColumnType("REAL");
b.Property<double>("OriginX")
.HasColumnType("REAL");
b.Property<double>("OriginY")
.HasColumnType("REAL");
b.Property<double>("Resolution")
.HasColumnType("REAL");
b.HasKey("Id");
b.HasIndex("LevelId")
.IsUnique();
b.ToTable("LayoutLevelEditorSettings");
});
modelBuilder.Entity("RobotNet10.MapManager.Data.LayoutVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreatedBy")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedDate")
.HasColumnType("TEXT");
b.Property<bool>("IsActive")
.HasColumnType("INTEGER");
b.Property<string>("LayoutDescription")
.HasColumnType("TEXT");
b.Property<Guid>("LayoutId")
.HasColumnType("TEXT");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
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("TEXT");
b.Property<Guid>("LevelId")
.HasColumnType("TEXT");
b.Property<string>("MapId")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("NodeDescription")
.HasColumnType("TEXT");
b.Property<string>("NodeId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("NodeName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<double>("X")
.HasColumnType("REAL");
b.Property<double>("Y")
.HasColumnType("REAL");
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("TEXT");
b.Property<string>("Actions")
.HasColumnType("TEXT");
b.Property<double?>("AllowedDeviationTheta")
.HasColumnType("REAL");
b.Property<double?>("AllowedDeviationXY")
.HasColumnType("REAL");
b.Property<Guid>("NodeId")
.HasColumnType("TEXT");
b.Property<double?>("Theta")
.HasColumnType("REAL");
b.Property<Guid>("VehicleTypeId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<Guid>("LevelId")
.HasColumnType("TEXT");
b.Property<string>("StationDescription")
.HasColumnType("TEXT");
b.Property<double?>("StationHeight")
.HasColumnType("REAL");
b.Property<string>("StationId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("StationName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<double?>("Theta")
.HasColumnType("REAL");
b.Property<double>("X")
.HasColumnType("REAL");
b.Property<double>("Y")
.HasColumnType("REAL");
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("TEXT");
b.Property<Guid>("NodeId")
.HasColumnType("TEXT");
b.Property<Guid>("StationId")
.HasColumnType("TEXT");
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("TEXT");
b.Property<string>("Actions")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedDate")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<bool>("IsActive")
.HasColumnType("INTEGER");
b.Property<string>("Specifications")
.HasColumnType("TEXT");
b.Property<string>("VehicleTypeId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<string>("VehicleTypeName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
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,72 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet10.ScriptEngine.Data;
#nullable disable
namespace RobotNet10.RobotApp.Data.Migrations.ScriptDb
{
[DbContext(typeof(ScriptEngineDbContext))]
[Migration("20260129034736_AddScriptDb")]
partial class AddScriptDb
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
modelBuilder.Entity("RobotNet10.ScriptEngine.Data.InstanceMission", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.HasColumnName("Id");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT")
.HasColumnName("CreatedAt");
b.Property<string>("Log")
.HasColumnType("TEXT")
.HasColumnName("Log");
b.Property<string>("MissionName")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("MissionName");
b.Property<string>("Parameters")
.HasColumnType("TEXT")
.HasColumnName("Parameters");
b.Property<int>("Score")
.HasColumnType("INTEGER")
.HasColumnName("Score");
b.Property<int>("State")
.HasColumnType("INTEGER")
.HasColumnName("State");
b.Property<DateTime>("StoppedAt")
.HasColumnType("TEXT")
.HasColumnName("StoppedAt");
b.Property<int>("TotalScore")
.HasColumnType("INTEGER")
.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.RobotApp.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: "TEXT", nullable: false),
MissionName = table.Column<string>(type: "TEXT", nullable: false),
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
Parameters = table.Column<string>(type: "TEXT", nullable: true),
TotalScore = table.Column<int>(type: "INTEGER", nullable: false),
State = table.Column<int>(type: "INTEGER", nullable: false),
Score = table.Column<int>(type: "INTEGER", nullable: false),
StoppedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
Log = table.Column<string>(type: "TEXT", 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,69 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet10.ScriptEngine.Data;
#nullable disable
namespace RobotNet10.RobotApp.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");
modelBuilder.Entity("RobotNet10.ScriptEngine.Data.InstanceMission", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.HasColumnName("Id");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT")
.HasColumnName("CreatedAt");
b.Property<string>("Log")
.HasColumnType("TEXT")
.HasColumnName("Log");
b.Property<string>("MissionName")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("MissionName");
b.Property<string>("Parameters")
.HasColumnType("TEXT")
.HasColumnName("Parameters");
b.Property<int>("Score")
.HasColumnType("INTEGER")
.HasColumnName("Score");
b.Property<int>("State")
.HasColumnType("INTEGER")
.HasColumnName("State");
b.Property<DateTime>("StoppedAt")
.HasColumnType("TEXT")
.HasColumnName("StoppedAt");
b.Property<int>("TotalScore")
.HasColumnType("INTEGER")
.HasColumnName("TotalScore");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.ToTable("InstanceMissions");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,325 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet10.NavigationTune.Data;
#nullable disable
namespace RobotNet10.RobotApp.Data.Migrations.TuneDb
{
[DbContext(typeof(TuningDbContext))]
[Migration("20260227022756_AddTunDb")]
partial class AddTunDb
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
modelBuilder.Entity("RobotNet10.NavigationTune.Data.TestScenarioEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ConfigJson")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<bool>("IsDefault")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.HasIndex("Name");
b.HasIndex("Type");
b.ToTable("test_scenarios", (string)null);
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.NavigationParameterSet", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("ControllerType")
.HasColumnType("INTEGER");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<string>("EstimatorConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<bool>("IsDefault")
.HasColumnType("INTEGER");
b.Property<string>("MotorDynamicsConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("MovePidConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("NavigationConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("PurePursuitConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("RotatePidConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("SignalConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("StanleyConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("TEXT");
b.Property<int>("Version")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.HasIndex("IsDefault");
b.HasIndex("Name");
b.ToTable("parameter_sets", (string)null);
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.SafetyViolation", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Message")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<int>("Severity")
.HasColumnType("INTEGER");
b.Property<Guid>("TestRunId")
.HasColumnType("TEXT");
b.Property<double>("Threshold")
.HasColumnType("REAL");
b.Property<DateTime>("Timestamp")
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<double>("Value")
.HasColumnType("REAL");
b.HasKey("Id");
b.HasIndex("TestRunId");
b.HasIndex("Timestamp");
b.HasIndex("TestRunId", "Timestamp");
b.ToTable("safety_violations", (string)null);
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.TestMetrics", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<double>("AccelerationStdDev")
.HasColumnType("REAL");
b.Property<double>("AverageSpeed")
.HasColumnType("REAL");
b.Property<double>("CompletionTime")
.HasColumnType("REAL");
b.Property<double>("CrossTrackErrorMean")
.HasColumnType("REAL");
b.Property<double>("CrossTrackErrorPeak")
.HasColumnType("REAL");
b.Property<double>("CrossTrackErrorRMS")
.HasColumnType("REAL");
b.Property<double>("CrossTrackErrorStdDev")
.HasColumnType("REAL");
b.Property<double>("EfficiencyScore")
.HasColumnType("REAL");
b.Property<double>("GoalHeadingError")
.HasColumnType("REAL");
b.Property<double>("GoalPositionError")
.HasColumnType("REAL");
b.Property<double>("HeadingErrorPeak")
.HasColumnType("REAL");
b.Property<double>("HeadingErrorRMS")
.HasColumnType("REAL");
b.Property<double>("MaxSpeed")
.HasColumnType("REAL");
b.Property<double>("OverallScore")
.HasColumnType("REAL");
b.Property<bool>("PassedCriteria")
.HasColumnType("INTEGER");
b.Property<double>("PathLengthRatio")
.HasColumnType("REAL");
b.Property<double>("SmoothnessScore")
.HasColumnType("REAL");
b.Property<Guid>("TestRunId")
.HasColumnType("TEXT");
b.Property<double>("TrackingScore")
.HasColumnType("REAL");
b.Property<double>("VelocityStdDev")
.HasColumnType("REAL");
b.HasKey("Id");
b.HasIndex("TestRunId")
.IsUnique();
b.ToTable("test_metrics", (string)null);
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.TestRun", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<DateTime?>("EndTime")
.HasColumnType("TEXT");
b.Property<string>("ErrorMessage")
.HasMaxLength(1000)
.HasColumnType("TEXT");
b.Property<string>("Notes")
.HasMaxLength(1000)
.HasColumnType("TEXT");
b.Property<Guid>("ParameterSetId")
.HasColumnType("TEXT");
b.Property<Guid>("ScenarioId")
.HasColumnType("TEXT");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
b.Property<int>("Status")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("ParameterSetId");
b.HasIndex("ScenarioId");
b.HasIndex("StartTime");
b.HasIndex("Status");
b.HasIndex("ScenarioId", "ParameterSetId");
b.ToTable("test_runs", (string)null);
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.SafetyViolation", b =>
{
b.HasOne("RobotNet10.NavigationTune.Shared.Models.TestRun", null)
.WithMany("SafetyViolations")
.HasForeignKey("TestRunId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.TestMetrics", b =>
{
b.HasOne("RobotNet10.NavigationTune.Shared.Models.TestRun", null)
.WithOne("Metrics")
.HasForeignKey("RobotNet10.NavigationTune.Shared.Models.TestMetrics", "TestRunId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.TestRun", b =>
{
b.Navigation("Metrics");
b.Navigation("SafetyViolations");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,233 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RobotNet10.RobotApp.Data.Migrations.TuneDb
{
/// <inheritdoc />
public partial class AddTunDb : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "parameter_sets",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", maxLength: 200, nullable: false),
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: true),
IsDefault = table.Column<bool>(type: "INTEGER", nullable: false),
Version = table.Column<int>(type: "INTEGER", nullable: false),
ControllerType = table.Column<int>(type: "INTEGER", nullable: false),
MovePidConfig = table.Column<string>(type: "TEXT", nullable: false),
RotatePidConfig = table.Column<string>(type: "TEXT", nullable: false),
PurePursuitConfig = table.Column<string>(type: "TEXT", nullable: false),
StanleyConfig = table.Column<string>(type: "TEXT", nullable: false),
EstimatorConfig = table.Column<string>(type: "TEXT", nullable: false),
SignalConfig = table.Column<string>(type: "TEXT", nullable: false),
MotorDynamicsConfig = table.Column<string>(type: "TEXT", nullable: false),
NavigationConfig = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_parameter_sets", x => x.Id);
});
migrationBuilder.CreateTable(
name: "test_runs",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
ScenarioId = table.Column<Guid>(type: "TEXT", nullable: false),
ParameterSetId = table.Column<Guid>(type: "TEXT", nullable: false),
StartTime = table.Column<DateTime>(type: "TEXT", nullable: false),
EndTime = table.Column<DateTime>(type: "TEXT", nullable: true),
Status = table.Column<int>(type: "INTEGER", nullable: false),
Duration = table.Column<double>(type: "REAL", nullable: false),
Notes = table.Column<string>(type: "TEXT", maxLength: 1000, nullable: true),
ErrorMessage = table.Column<string>(type: "TEXT", maxLength: 1000, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_test_runs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "test_scenarios",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", maxLength: 200, nullable: false),
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
Type = table.Column<int>(type: "INTEGER", nullable: false),
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
IsDefault = table.Column<bool>(type: "INTEGER", nullable: false),
ConfigJson = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_test_scenarios", x => x.Id);
});
migrationBuilder.CreateTable(
name: "safety_violations",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
TestRunId = table.Column<Guid>(type: "TEXT", nullable: false),
Timestamp = table.Column<DateTime>(type: "TEXT", nullable: false),
Type = table.Column<int>(type: "INTEGER", nullable: false),
Severity = table.Column<int>(type: "INTEGER", nullable: false),
Value = table.Column<double>(type: "REAL", nullable: false),
Threshold = table.Column<double>(type: "REAL", nullable: false),
Message = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_safety_violations", x => x.Id);
table.ForeignKey(
name: "FK_safety_violations_test_runs_TestRunId",
column: x => x.TestRunId,
principalTable: "test_runs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "test_metrics",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
TestRunId = table.Column<Guid>(type: "TEXT", nullable: false),
CrossTrackErrorRMS = table.Column<double>(type: "REAL", nullable: false),
CrossTrackErrorPeak = table.Column<double>(type: "REAL", nullable: false),
CrossTrackErrorMean = table.Column<double>(type: "REAL", nullable: false),
CrossTrackErrorStdDev = table.Column<double>(type: "REAL", nullable: false),
HeadingErrorRMS = table.Column<double>(type: "REAL", nullable: false),
HeadingErrorPeak = table.Column<double>(type: "REAL", nullable: false),
GoalPositionError = table.Column<double>(type: "REAL", nullable: false),
GoalHeadingError = table.Column<double>(type: "REAL", nullable: false),
VelocityStdDev = table.Column<double>(type: "REAL", nullable: false),
AccelerationStdDev = table.Column<double>(type: "REAL", nullable: false),
PathLengthRatio = table.Column<double>(type: "REAL", nullable: false),
CompletionTime = table.Column<double>(type: "REAL", nullable: false),
AverageSpeed = table.Column<double>(type: "REAL", nullable: false),
MaxSpeed = table.Column<double>(type: "REAL", nullable: false),
OverallScore = table.Column<double>(type: "REAL", nullable: false),
TrackingScore = table.Column<double>(type: "REAL", nullable: false),
SmoothnessScore = table.Column<double>(type: "REAL", nullable: false),
EfficiencyScore = table.Column<double>(type: "REAL", nullable: false),
PassedCriteria = table.Column<bool>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_test_metrics", x => x.Id);
table.ForeignKey(
name: "FK_test_metrics_test_runs_TestRunId",
column: x => x.TestRunId,
principalTable: "test_runs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_parameter_sets_CreatedAt",
table: "parameter_sets",
column: "CreatedAt");
migrationBuilder.CreateIndex(
name: "IX_parameter_sets_IsDefault",
table: "parameter_sets",
column: "IsDefault");
migrationBuilder.CreateIndex(
name: "IX_parameter_sets_Name",
table: "parameter_sets",
column: "Name");
migrationBuilder.CreateIndex(
name: "IX_safety_violations_TestRunId",
table: "safety_violations",
column: "TestRunId");
migrationBuilder.CreateIndex(
name: "IX_safety_violations_TestRunId_Timestamp",
table: "safety_violations",
columns: new[] { "TestRunId", "Timestamp" });
migrationBuilder.CreateIndex(
name: "IX_safety_violations_Timestamp",
table: "safety_violations",
column: "Timestamp");
migrationBuilder.CreateIndex(
name: "IX_test_metrics_TestRunId",
table: "test_metrics",
column: "TestRunId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_test_runs_ParameterSetId",
table: "test_runs",
column: "ParameterSetId");
migrationBuilder.CreateIndex(
name: "IX_test_runs_ScenarioId",
table: "test_runs",
column: "ScenarioId");
migrationBuilder.CreateIndex(
name: "IX_test_runs_ScenarioId_ParameterSetId",
table: "test_runs",
columns: new[] { "ScenarioId", "ParameterSetId" });
migrationBuilder.CreateIndex(
name: "IX_test_runs_StartTime",
table: "test_runs",
column: "StartTime");
migrationBuilder.CreateIndex(
name: "IX_test_runs_Status",
table: "test_runs",
column: "Status");
migrationBuilder.CreateIndex(
name: "IX_test_scenarios_CreatedAt",
table: "test_scenarios",
column: "CreatedAt");
migrationBuilder.CreateIndex(
name: "IX_test_scenarios_Name",
table: "test_scenarios",
column: "Name");
migrationBuilder.CreateIndex(
name: "IX_test_scenarios_Type",
table: "test_scenarios",
column: "Type");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "parameter_sets");
migrationBuilder.DropTable(
name: "safety_violations");
migrationBuilder.DropTable(
name: "test_metrics");
migrationBuilder.DropTable(
name: "test_scenarios");
migrationBuilder.DropTable(
name: "test_runs");
}
}
}

View File

@@ -0,0 +1,322 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RobotNet10.NavigationTune.Data;
#nullable disable
namespace RobotNet10.RobotApp.Data.Migrations.TuneDb
{
[DbContext(typeof(TuningDbContext))]
partial class TuningDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.2");
modelBuilder.Entity("RobotNet10.NavigationTune.Data.TestScenarioEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ConfigJson")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<bool>("IsDefault")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.HasIndex("Name");
b.HasIndex("Type");
b.ToTable("test_scenarios", (string)null);
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.NavigationParameterSet", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("ControllerType")
.HasColumnType("INTEGER");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<string>("EstimatorConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<bool>("IsDefault")
.HasColumnType("INTEGER");
b.Property<string>("MotorDynamicsConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("MovePidConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("NavigationConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("PurePursuitConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("RotatePidConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("SignalConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("StanleyConfig")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("TEXT");
b.Property<int>("Version")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.HasIndex("IsDefault");
b.HasIndex("Name");
b.ToTable("parameter_sets", (string)null);
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.SafetyViolation", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Message")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<int>("Severity")
.HasColumnType("INTEGER");
b.Property<Guid>("TestRunId")
.HasColumnType("TEXT");
b.Property<double>("Threshold")
.HasColumnType("REAL");
b.Property<DateTime>("Timestamp")
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<double>("Value")
.HasColumnType("REAL");
b.HasKey("Id");
b.HasIndex("TestRunId");
b.HasIndex("Timestamp");
b.HasIndex("TestRunId", "Timestamp");
b.ToTable("safety_violations", (string)null);
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.TestMetrics", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<double>("AccelerationStdDev")
.HasColumnType("REAL");
b.Property<double>("AverageSpeed")
.HasColumnType("REAL");
b.Property<double>("CompletionTime")
.HasColumnType("REAL");
b.Property<double>("CrossTrackErrorMean")
.HasColumnType("REAL");
b.Property<double>("CrossTrackErrorPeak")
.HasColumnType("REAL");
b.Property<double>("CrossTrackErrorRMS")
.HasColumnType("REAL");
b.Property<double>("CrossTrackErrorStdDev")
.HasColumnType("REAL");
b.Property<double>("EfficiencyScore")
.HasColumnType("REAL");
b.Property<double>("GoalHeadingError")
.HasColumnType("REAL");
b.Property<double>("GoalPositionError")
.HasColumnType("REAL");
b.Property<double>("HeadingErrorPeak")
.HasColumnType("REAL");
b.Property<double>("HeadingErrorRMS")
.HasColumnType("REAL");
b.Property<double>("MaxSpeed")
.HasColumnType("REAL");
b.Property<double>("OverallScore")
.HasColumnType("REAL");
b.Property<bool>("PassedCriteria")
.HasColumnType("INTEGER");
b.Property<double>("PathLengthRatio")
.HasColumnType("REAL");
b.Property<double>("SmoothnessScore")
.HasColumnType("REAL");
b.Property<Guid>("TestRunId")
.HasColumnType("TEXT");
b.Property<double>("TrackingScore")
.HasColumnType("REAL");
b.Property<double>("VelocityStdDev")
.HasColumnType("REAL");
b.HasKey("Id");
b.HasIndex("TestRunId")
.IsUnique();
b.ToTable("test_metrics", (string)null);
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.TestRun", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<DateTime?>("EndTime")
.HasColumnType("TEXT");
b.Property<string>("ErrorMessage")
.HasMaxLength(1000)
.HasColumnType("TEXT");
b.Property<string>("Notes")
.HasMaxLength(1000)
.HasColumnType("TEXT");
b.Property<Guid>("ParameterSetId")
.HasColumnType("TEXT");
b.Property<Guid>("ScenarioId")
.HasColumnType("TEXT");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
b.Property<int>("Status")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("ParameterSetId");
b.HasIndex("ScenarioId");
b.HasIndex("StartTime");
b.HasIndex("Status");
b.HasIndex("ScenarioId", "ParameterSetId");
b.ToTable("test_runs", (string)null);
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.SafetyViolation", b =>
{
b.HasOne("RobotNet10.NavigationTune.Shared.Models.TestRun", null)
.WithMany("SafetyViolations")
.HasForeignKey("TestRunId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.TestMetrics", b =>
{
b.HasOne("RobotNet10.NavigationTune.Shared.Models.TestRun", null)
.WithOne("Metrics")
.HasForeignKey("RobotNet10.NavigationTune.Shared.Models.TestMetrics", "TestRunId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RobotNet10.NavigationTune.Shared.Models.TestRun", b =>
{
b.Navigation("Metrics");
b.Navigation("SafetyViolations");
});
#pragma warning restore 612, 618
}
}
}