using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace RobotNet10.RobotApp.Data.Migrations.AppDb { /// public partial class AddDockStationConfig : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "DockStationConfig", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), StationId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), ConfigName = table.Column(type: "nvarchar(64)", maxLength: 100, nullable: true), Description = table.Column(type: "ntext", maxLength: 500, nullable: true), X = table.Column(type: "double", nullable: false), Y = table.Column(type: "double", nullable: false), Yaw = table.Column(type: "double", nullable: false), Width = table.Column(type: "double", nullable: false), Length = table.Column(type: "double", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false), UpdatedAt = table.Column(type: "datetime2", nullable: false), IsActive = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_DockStationConfig", x => x.Id); }); migrationBuilder.CreateTable( name: "DockStationMarkerEntry", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), DockStationConfigId = table.Column(type: "uniqueidentifier", nullable: false), MarkerId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Type = table.Column(type: "int", nullable: false), Priority = table.Column(type: "int", nullable: false), DeviceId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), Code = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), ReferencePointsJson = table.Column(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"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "DockStationMarkerEntry"); migrationBuilder.DropTable( name: "DockStationConfig"); } } }