99 lines
5.1 KiB
C#
99 lines
5.1 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace AmtScanner.Api.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddAmtNewTables : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "AmtDevices_new",
|
|
columns: table => new
|
|
{
|
|
Uuid = table.Column<string>(type: "varchar(36)", maxLength: 36, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
IpAddress = table.Column<string>(type: "varchar(45)", maxLength: 45, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
SubnetMask = table.Column<string>(type: "varchar(45)", maxLength: 45, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Gateway = table.Column<string>(type: "varchar(45)", maxLength: 45, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
AmtUsername = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
AmtPassword = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
AmtVersion = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Hostname = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
UpdatedAt = table.Column<DateTime>(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<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
IpAddress = table.Column<string>(type: "varchar(45)", maxLength: 45, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
SubnetMask = table.Column<string>(type: "varchar(45)", maxLength: 45, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Gateway = table.Column<string>(type: "varchar(45)", maxLength: 45, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
AmtUsername = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
AmtPassword = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
AmtVersion = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ProvisioningState = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Source = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
IsTakenOver = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
UpdatedAt = table.Column<DateTime>(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);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "AmtDevices_new");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AmtPendingDevices_new");
|
|
}
|
|
}
|
|
}
|