Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class RemoveVirtualMachineTargetAndProvider : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ProviderType",
|
||||
table: "VirtualMachines");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TargetType",
|
||||
table: "VirtualMachines");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "MetadataJson",
|
||||
table: "VirtualMachines",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true)
|
||||
.Annotation("Relational:ColumnOrder", 4)
|
||||
.OldAnnotation("Relational:ColumnOrder", 6);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ExternalId",
|
||||
table: "VirtualMachines",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true)
|
||||
.Annotation("Relational:ColumnOrder", 3)
|
||||
.OldAnnotation("Relational:ColumnOrder", 5);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "MetadataJson",
|
||||
table: "VirtualMachines",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true)
|
||||
.Annotation("Relational:ColumnOrder", 6)
|
||||
.OldAnnotation("Relational:ColumnOrder", 4);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ExternalId",
|
||||
table: "VirtualMachines",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true)
|
||||
.Annotation("Relational:ColumnOrder", 5)
|
||||
.OldAnnotation("Relational:ColumnOrder", 3);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ProviderType",
|
||||
table: "VirtualMachines",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true)
|
||||
.Annotation("Relational:ColumnOrder", 4);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "TargetType",
|
||||
table: "VirtualMachines",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "")
|
||||
.Annotation("Relational:ColumnOrder", 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user