using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace AmtScanner.Api.Migrations { /// public partial class AddAmtNewTables : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AmtDevices_new", columns: table => new { Uuid = table.Column(type: "varchar(36)", maxLength: 36, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), IpAddress = table.Column(type: "varchar(45)", maxLength: 45, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), SubnetMask = table.Column(type: "varchar(45)", maxLength: 45, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Gateway = table.Column(type: "varchar(45)", maxLength: 45, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), AmtUsername = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), AmtPassword = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), AmtVersion = table.Column(type: "varchar(20)", maxLength: 20, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Hostname = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreatedAt = table.Column(type: "datetime(6)", nullable: false), UpdatedAt = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AmtDevices_new", x => x.Uuid); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AmtPendingDevices_new", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), IpAddress = table.Column(type: "varchar(45)", maxLength: 45, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), SubnetMask = table.Column(type: "varchar(45)", maxLength: 45, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Gateway = table.Column(type: "varchar(45)", maxLength: 45, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), AmtUsername = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), AmtPassword = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), AmtVersion = table.Column(type: "varchar(20)", maxLength: 20, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ProvisioningState = table.Column(type: "varchar(20)", maxLength: 20, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Source = table.Column(type: "varchar(20)", maxLength: 20, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), IsTakenOver = table.Column(type: "tinyint(1)", nullable: false), CreatedAt = table.Column(type: "datetime(6)", nullable: false), UpdatedAt = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AmtPendingDevices_new", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_AmtDevices_new_IpAddress", table: "AmtDevices_new", column: "IpAddress"); migrationBuilder.CreateIndex( name: "IX_AmtPendingDevices_new_IpAddress", table: "AmtPendingDevices_new", column: "IpAddress", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AmtDevices_new"); migrationBuilder.DropTable( name: "AmtPendingDevices_new"); } } }