Refactor code structure for improved readability and maintainability

This commit is contained in:
Torsten Brendgen
2026-05-16 16:45:28 +02:00
parent 14f856fdb3
commit 96a3e98109
426 changed files with 29236 additions and 114 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class AddQueueJobs : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// No-op migration. Queue schema can already exist from a partial/manual run.
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
// No-op migration.
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class AddQueueJobModelSnapshotFix : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// No-op migration. Queue schema is created by AddQueueJobs.
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
// No-op migration. Queue schema rollback is handled by AddQueueJobs.
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,119 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class AddEnvironmentAndTargetProviderModel : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ExternalId",
table: "VirtualMachines",
type: "nvarchar(max)",
nullable: true)
.Annotation("Relational:ColumnOrder", 5);
migrationBuilder.AddColumn<string>(
name: "MetadataJson",
table: "VirtualMachines",
type: "nvarchar(max)",
nullable: true)
.Annotation("Relational:ColumnOrder", 6);
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);
migrationBuilder.AddColumn<string>(
name: "EnvironmentType",
table: "Environments",
type: "nvarchar(max)",
nullable: false,
defaultValue: "")
.Annotation("Relational:ColumnOrder", 3);
migrationBuilder.AddColumn<string>(
name: "MetadataJson",
table: "Environments",
type: "nvarchar(max)",
nullable: true)
.Annotation("Relational:ColumnOrder", 7);
migrationBuilder.AddColumn<string>(
name: "ProviderType",
table: "Environments",
type: "nvarchar(max)",
nullable: true)
.Annotation("Relational:ColumnOrder", 4);
migrationBuilder.AddColumn<string>(
name: "SubscriptionId",
table: "Environments",
type: "nvarchar(max)",
nullable: true)
.Annotation("Relational:ColumnOrder", 6);
migrationBuilder.AddColumn<string>(
name: "TenantId",
table: "Environments",
type: "nvarchar(max)",
nullable: true)
.Annotation("Relational:ColumnOrder", 5);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ExternalId",
table: "VirtualMachines");
migrationBuilder.DropColumn(
name: "MetadataJson",
table: "VirtualMachines");
migrationBuilder.DropColumn(
name: "ProviderType",
table: "VirtualMachines");
migrationBuilder.DropColumn(
name: "TargetType",
table: "VirtualMachines");
migrationBuilder.DropColumn(
name: "EnvironmentType",
table: "Environments");
migrationBuilder.DropColumn(
name: "MetadataJson",
table: "Environments");
migrationBuilder.DropColumn(
name: "ProviderType",
table: "Environments");
migrationBuilder.DropColumn(
name: "SubscriptionId",
table: "Environments");
migrationBuilder.DropColumn(
name: "TenantId",
table: "Environments");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,138 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class RemoveCloudEnabledFromEnvironment : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CloudEnabled",
table: "Environments");
migrationBuilder.AlterColumn<string>(
name: "TenantId",
table: "Environments",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true)
.Annotation("Relational:ColumnOrder", 4)
.OldAnnotation("Relational:ColumnOrder", 5);
migrationBuilder.AlterColumn<string>(
name: "SubscriptionId",
table: "Environments",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true)
.Annotation("Relational:ColumnOrder", 5)
.OldAnnotation("Relational:ColumnOrder", 6);
migrationBuilder.AlterColumn<string>(
name: "ProviderType",
table: "Environments",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true)
.Annotation("Relational:ColumnOrder", 3)
.OldAnnotation("Relational:ColumnOrder", 4);
migrationBuilder.AlterColumn<string>(
name: "MetadataJson",
table: "Environments",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true)
.Annotation("Relational:ColumnOrder", 6)
.OldAnnotation("Relational:ColumnOrder", 7);
migrationBuilder.AlterColumn<string>(
name: "EnvironmentType",
table: "Environments",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)")
.Annotation("Relational:ColumnOrder", 2)
.OldAnnotation("Relational:ColumnOrder", 3);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "TenantId",
table: "Environments",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true)
.Annotation("Relational:ColumnOrder", 5)
.OldAnnotation("Relational:ColumnOrder", 4);
migrationBuilder.AlterColumn<string>(
name: "SubscriptionId",
table: "Environments",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true)
.Annotation("Relational:ColumnOrder", 6)
.OldAnnotation("Relational:ColumnOrder", 5);
migrationBuilder.AlterColumn<string>(
name: "ProviderType",
table: "Environments",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true)
.Annotation("Relational:ColumnOrder", 4)
.OldAnnotation("Relational:ColumnOrder", 3);
migrationBuilder.AlterColumn<string>(
name: "MetadataJson",
table: "Environments",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true)
.Annotation("Relational:ColumnOrder", 7)
.OldAnnotation("Relational:ColumnOrder", 6);
migrationBuilder.AlterColumn<string>(
name: "EnvironmentType",
table: "Environments",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)")
.Annotation("Relational:ColumnOrder", 3)
.OldAnnotation("Relational:ColumnOrder", 2);
migrationBuilder.AddColumn<bool>(
name: "CloudEnabled",
table: "Environments",
type: "bit",
nullable: false,
defaultValue: false)
.Annotation("Relational:ColumnOrder", 2);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -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);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,60 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class MakeVirtualMachineDomainOptionalAndAddLinkUnlinkFlow : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_VirtualMachines_Domains_DomainID",
table: "VirtualMachines");
migrationBuilder.AlterColumn<Guid>(
name: "DomainID",
table: "VirtualMachines",
type: "uniqueidentifier",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
migrationBuilder.AddForeignKey(
name: "FK_VirtualMachines_Domains_DomainID",
table: "VirtualMachines",
column: "DomainID",
principalTable: "Domains",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_VirtualMachines_Domains_DomainID",
table: "VirtualMachines");
migrationBuilder.AlterColumn<Guid>(
name: "DomainID",
table: "VirtualMachines",
type: "uniqueidentifier",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "uniqueidentifier",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_VirtualMachines_Domains_DomainID",
table: "VirtualMachines",
column: "DomainID",
principalTable: "Domains",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,67 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class AddServiceCloudFlagAndRoleDefinitionsV2 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsCloudService",
table: "Services",
type: "bit",
nullable: false,
defaultValue: false)
.Annotation("Relational:ColumnOrder", 3);
migrationBuilder.CreateTable(
name: "ServiceRoleDefinitions",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
ServiceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Key = table.Column<string>(type: "nvarchar(max)", nullable: false),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
MinCount = table.Column<int>(type: "int", nullable: false),
MaxCount = table.Column<int>(type: "int", nullable: false),
DefaultStageOrder = table.Column<int>(type: "int", nullable: false),
Modified = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETDATE()"),
ModifiedBy = table.Column<string>(type: "nvarchar(max)", nullable: false),
Created = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETDATE()"),
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceRoleDefinitions", x => x.Id);
table.ForeignKey(
name: "FK_ServiceRoleDefinitions_Services_ServiceId",
column: x => x.ServiceId,
principalTable: "Services",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_ServiceRoleDefinitions_ServiceId",
table: "ServiceRoleDefinitions",
column: "ServiceId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ServiceRoleDefinitions");
migrationBuilder.DropColumn(
name: "IsCloudService",
table: "Services");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,51 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class RemoveRoleDefinitionSizingFields : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DefaultStageOrder",
table: "ServiceRoleDefinitions");
migrationBuilder.DropColumn(
name: "MaxCount",
table: "ServiceRoleDefinitions");
migrationBuilder.DropColumn(
name: "MinCount",
table: "ServiceRoleDefinitions");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "DefaultStageOrder",
table: "ServiceRoleDefinitions",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "MaxCount",
table: "ServiceRoleDefinitions",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "MinCount",
table: "ServiceRoleDefinitions",
type: "int",
nullable: false,
defaultValue: 0);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class RemoveTemplateCategoryLegacyFields : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ParentCategoryName",
table: "TemplateCategories");
migrationBuilder.DropColumn(
name: "showOrder",
table: "TemplateCategories");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ParentCategoryName",
table: "TemplateCategories",
type: "nvarchar(max)",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<int>(
name: "showOrder",
table: "TemplateCategories",
type: "int",
nullable: false,
defaultValue: 0);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,59 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class AddTemplateCategoryMetadataFields : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Color",
table: "TemplateCategories",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "TemplateCategories",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "IconKey",
table: "TemplateCategories",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "TemplateCategories",
type: "bit",
nullable: false,
defaultValue: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Color",
table: "TemplateCategories");
migrationBuilder.DropColumn(
name: "Description",
table: "TemplateCategories");
migrationBuilder.DropColumn(
name: "IconKey",
table: "TemplateCategories");
migrationBuilder.DropColumn(
name: "IsActive",
table: "TemplateCategories");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class MoveIconKeyFromTemplateCategoryToService : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IconKey",
table: "TemplateCategories");
migrationBuilder.AddColumn<string>(
name: "IconKey",
table: "Services",
type: "nvarchar(max)",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IconKey",
table: "Services");
migrationBuilder.AddColumn<string>(
name: "IconKey",
table: "TemplateCategories",
type: "nvarchar(max)",
nullable: true);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class RemoveTemplateCloudFlag : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CloudTemplate",
table: "Templates");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "CloudTemplate",
table: "Templates",
type: "bit",
nullable: false,
defaultValue: false);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,178 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class AddDeploymentRulesAndQueueJobSteps : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "DeploymentRuleId",
table: "Templates",
type: "uniqueidentifier",
nullable: true)
.Annotation("Relational:ColumnOrder", 6);
migrationBuilder.AddColumn<string>(
name: "MetadataJson",
table: "QueueJobs",
type: "nvarchar(max)",
nullable: true)
.Annotation("Relational:ColumnOrder", 11);
migrationBuilder.AddColumn<string>(
name: "RuleSnapshotJson",
table: "QueueJobs",
type: "nvarchar(max)",
nullable: true)
.Annotation("Relational:ColumnOrder", 12);
migrationBuilder.CreateTable(
name: "DeploymentRules",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false),
Modified = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETDATE()"),
ModifiedBy = table.Column<string>(type: "nvarchar(max)", nullable: false),
Created = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETDATE()"),
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DeploymentRules", x => x.Id);
});
migrationBuilder.CreateTable(
name: "QueueJobSteps",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
QueueJobId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
DependsOnQueueJobStepId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
SortOrder = table.Column<int>(type: "int", nullable: false),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
StepType = table.Column<string>(type: "nvarchar(max)", nullable: false),
Status = table.Column<string>(type: "nvarchar(max)", nullable: false),
MetadataJson = table.Column<string>(type: "nvarchar(max)", nullable: true),
ApprovedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
ApprovedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
ApprovalComment = table.Column<string>(type: "nvarchar(max)", nullable: true),
Modified = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETDATE()"),
ModifiedBy = table.Column<string>(type: "nvarchar(max)", nullable: false),
Created = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETDATE()"),
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_QueueJobSteps", x => x.Id);
table.ForeignKey(
name: "FK_QueueJobSteps_QueueJobSteps_DependsOnQueueJobStepId",
column: x => x.DependsOnQueueJobStepId,
principalTable: "QueueJobSteps",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_QueueJobSteps_QueueJobs_QueueJobId",
column: x => x.QueueJobId,
principalTable: "QueueJobs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "DeploymentRuleSteps",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
DeploymentRuleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
SortOrder = table.Column<int>(type: "int", nullable: false),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
StepType = table.Column<string>(type: "nvarchar(max)", nullable: false),
RequiresApproval = table.Column<bool>(type: "bit", nullable: false),
MetadataJson = table.Column<string>(type: "nvarchar(max)", nullable: true),
Modified = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETDATE()"),
ModifiedBy = table.Column<string>(type: "nvarchar(max)", nullable: false),
Created = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETDATE()"),
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DeploymentRuleSteps", x => x.Id);
table.ForeignKey(
name: "FK_DeploymentRuleSteps_DeploymentRules_DeploymentRuleId",
column: x => x.DeploymentRuleId,
principalTable: "DeploymentRules",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Templates_DeploymentRuleId",
table: "Templates",
column: "DeploymentRuleId");
migrationBuilder.CreateIndex(
name: "IX_DeploymentRuleSteps_DeploymentRuleId",
table: "DeploymentRuleSteps",
column: "DeploymentRuleId");
migrationBuilder.CreateIndex(
name: "IX_QueueJobSteps_DependsOnQueueJobStepId",
table: "QueueJobSteps",
column: "DependsOnQueueJobStepId");
migrationBuilder.CreateIndex(
name: "IX_QueueJobSteps_QueueJobId",
table: "QueueJobSteps",
column: "QueueJobId");
migrationBuilder.AddForeignKey(
name: "FK_Templates_DeploymentRules_DeploymentRuleId",
table: "Templates",
column: "DeploymentRuleId",
principalTable: "DeploymentRules",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Templates_DeploymentRules_DeploymentRuleId",
table: "Templates");
migrationBuilder.DropTable(
name: "DeploymentRuleSteps");
migrationBuilder.DropTable(
name: "QueueJobSteps");
migrationBuilder.DropTable(
name: "DeploymentRules");
migrationBuilder.DropIndex(
name: "IX_Templates_DeploymentRuleId",
table: "Templates");
migrationBuilder.DropColumn(
name: "DeploymentRuleId",
table: "Templates");
migrationBuilder.DropColumn(
name: "MetadataJson",
table: "QueueJobs");
migrationBuilder.DropColumn(
name: "RuleSnapshotJson",
table: "QueueJobs");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,384 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class RenameDeploymentAndJobTables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DeploymentGroups_Templates_TemplateId",
table: "DeploymentGroups");
migrationBuilder.DropForeignKey(
name: "FK_Deployments_DeploymentGroups_DeploymentGroupId",
table: "Deployments");
migrationBuilder.DropForeignKey(
name: "FK_Deployments_VirtualMachines_VirtualMachineId",
table: "Deployments");
migrationBuilder.DropForeignKey(
name: "FK_Jobs_Deployments_DeploymentId",
table: "Jobs");
migrationBuilder.DropForeignKey(
name: "FK_QueueJobSteps_QueueJobSteps_DependsOnQueueJobStepId",
table: "QueueJobSteps");
migrationBuilder.DropForeignKey(
name: "FK_QueueJobSteps_QueueJobs_QueueJobId",
table: "QueueJobSteps");
migrationBuilder.DropForeignKey(
name: "FK_QueueJobTargets_QueueJobs_QueueJobId",
table: "QueueJobTargets");
migrationBuilder.DropPrimaryKey(
name: "PK_QueueJobTargets",
table: "QueueJobTargets");
migrationBuilder.DropPrimaryKey(
name: "PK_QueueJobSteps",
table: "QueueJobSteps");
migrationBuilder.DropPrimaryKey(
name: "PK_QueueJobs",
table: "QueueJobs");
migrationBuilder.DropUniqueConstraint(
name: "AK_Deployments_Id",
table: "Deployments");
migrationBuilder.DropPrimaryKey(
name: "PK_Deployments",
table: "Deployments");
migrationBuilder.DropPrimaryKey(
name: "PK_DeploymentGroups",
table: "DeploymentGroups");
migrationBuilder.RenameTable(
name: "QueueJobTargets",
newName: "DeploymentJobTargets");
migrationBuilder.RenameTable(
name: "QueueJobSteps",
newName: "DeploymentJobSteps");
migrationBuilder.RenameTable(
name: "QueueJobs",
newName: "DeploymentJobs");
migrationBuilder.RenameTable(
name: "Deployments",
newName: "DeploymentExecutions");
migrationBuilder.RenameTable(
name: "DeploymentGroups",
newName: "DeploymentBatches");
migrationBuilder.RenameIndex(
name: "IX_QueueJobTargets_QueueJobId",
table: "DeploymentJobTargets",
newName: "IX_DeploymentJobTargets_QueueJobId");
migrationBuilder.RenameIndex(
name: "IX_QueueJobSteps_QueueJobId",
table: "DeploymentJobSteps",
newName: "IX_DeploymentJobSteps_QueueJobId");
migrationBuilder.RenameIndex(
name: "IX_QueueJobSteps_DependsOnQueueJobStepId",
table: "DeploymentJobSteps",
newName: "IX_DeploymentJobSteps_DependsOnQueueJobStepId");
migrationBuilder.RenameIndex(
name: "IX_Deployments_DeploymentGroupId",
table: "DeploymentExecutions",
newName: "IX_DeploymentExecutions_DeploymentGroupId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentGroups_TemplateId",
table: "DeploymentBatches",
newName: "IX_DeploymentBatches_TemplateId");
migrationBuilder.AddPrimaryKey(
name: "PK_DeploymentJobTargets",
table: "DeploymentJobTargets",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_DeploymentJobSteps",
table: "DeploymentJobSteps",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_DeploymentJobs",
table: "DeploymentJobs",
column: "Id");
migrationBuilder.AddUniqueConstraint(
name: "AK_DeploymentExecutions_Id",
table: "DeploymentExecutions",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_DeploymentExecutions",
table: "DeploymentExecutions",
columns: new[] { "VirtualMachineId", "DeploymentGroupId" });
migrationBuilder.AddPrimaryKey(
name: "PK_DeploymentBatches",
table: "DeploymentBatches",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_DeploymentBatches_Templates_TemplateId",
table: "DeploymentBatches",
column: "TemplateId",
principalTable: "Templates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DeploymentExecutions_DeploymentBatches_DeploymentGroupId",
table: "DeploymentExecutions",
column: "DeploymentGroupId",
principalTable: "DeploymentBatches",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DeploymentExecutions_VirtualMachines_VirtualMachineId",
table: "DeploymentExecutions",
column: "VirtualMachineId",
principalTable: "VirtualMachines",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DeploymentJobSteps_DeploymentJobSteps_DependsOnQueueJobStepId",
table: "DeploymentJobSteps",
column: "DependsOnQueueJobStepId",
principalTable: "DeploymentJobSteps",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_DeploymentJobSteps_DeploymentJobs_QueueJobId",
table: "DeploymentJobSteps",
column: "QueueJobId",
principalTable: "DeploymentJobs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DeploymentJobTargets_DeploymentJobs_QueueJobId",
table: "DeploymentJobTargets",
column: "QueueJobId",
principalTable: "DeploymentJobs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Jobs_DeploymentExecutions_DeploymentId",
table: "Jobs",
column: "DeploymentId",
principalTable: "DeploymentExecutions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DeploymentBatches_Templates_TemplateId",
table: "DeploymentBatches");
migrationBuilder.DropForeignKey(
name: "FK_DeploymentExecutions_DeploymentBatches_DeploymentGroupId",
table: "DeploymentExecutions");
migrationBuilder.DropForeignKey(
name: "FK_DeploymentExecutions_VirtualMachines_VirtualMachineId",
table: "DeploymentExecutions");
migrationBuilder.DropForeignKey(
name: "FK_DeploymentJobSteps_DeploymentJobSteps_DependsOnQueueJobStepId",
table: "DeploymentJobSteps");
migrationBuilder.DropForeignKey(
name: "FK_DeploymentJobSteps_DeploymentJobs_QueueJobId",
table: "DeploymentJobSteps");
migrationBuilder.DropForeignKey(
name: "FK_DeploymentJobTargets_DeploymentJobs_QueueJobId",
table: "DeploymentJobTargets");
migrationBuilder.DropForeignKey(
name: "FK_Jobs_DeploymentExecutions_DeploymentId",
table: "Jobs");
migrationBuilder.DropPrimaryKey(
name: "PK_DeploymentJobTargets",
table: "DeploymentJobTargets");
migrationBuilder.DropPrimaryKey(
name: "PK_DeploymentJobSteps",
table: "DeploymentJobSteps");
migrationBuilder.DropPrimaryKey(
name: "PK_DeploymentJobs",
table: "DeploymentJobs");
migrationBuilder.DropUniqueConstraint(
name: "AK_DeploymentExecutions_Id",
table: "DeploymentExecutions");
migrationBuilder.DropPrimaryKey(
name: "PK_DeploymentExecutions",
table: "DeploymentExecutions");
migrationBuilder.DropPrimaryKey(
name: "PK_DeploymentBatches",
table: "DeploymentBatches");
migrationBuilder.RenameTable(
name: "DeploymentJobTargets",
newName: "QueueJobTargets");
migrationBuilder.RenameTable(
name: "DeploymentJobSteps",
newName: "QueueJobSteps");
migrationBuilder.RenameTable(
name: "DeploymentJobs",
newName: "QueueJobs");
migrationBuilder.RenameTable(
name: "DeploymentExecutions",
newName: "Deployments");
migrationBuilder.RenameTable(
name: "DeploymentBatches",
newName: "DeploymentGroups");
migrationBuilder.RenameIndex(
name: "IX_DeploymentJobTargets_QueueJobId",
table: "QueueJobTargets",
newName: "IX_QueueJobTargets_QueueJobId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentJobSteps_QueueJobId",
table: "QueueJobSteps",
newName: "IX_QueueJobSteps_QueueJobId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentJobSteps_DependsOnQueueJobStepId",
table: "QueueJobSteps",
newName: "IX_QueueJobSteps_DependsOnQueueJobStepId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentExecutions_DeploymentGroupId",
table: "Deployments",
newName: "IX_Deployments_DeploymentGroupId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentBatches_TemplateId",
table: "DeploymentGroups",
newName: "IX_DeploymentGroups_TemplateId");
migrationBuilder.AddPrimaryKey(
name: "PK_QueueJobTargets",
table: "QueueJobTargets",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_QueueJobSteps",
table: "QueueJobSteps",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_QueueJobs",
table: "QueueJobs",
column: "Id");
migrationBuilder.AddUniqueConstraint(
name: "AK_Deployments_Id",
table: "Deployments",
column: "Id");
migrationBuilder.AddPrimaryKey(
name: "PK_Deployments",
table: "Deployments",
columns: new[] { "VirtualMachineId", "DeploymentGroupId" });
migrationBuilder.AddPrimaryKey(
name: "PK_DeploymentGroups",
table: "DeploymentGroups",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_DeploymentGroups_Templates_TemplateId",
table: "DeploymentGroups",
column: "TemplateId",
principalTable: "Templates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Deployments_DeploymentGroups_DeploymentGroupId",
table: "Deployments",
column: "DeploymentGroupId",
principalTable: "DeploymentGroups",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Deployments_VirtualMachines_VirtualMachineId",
table: "Deployments",
column: "VirtualMachineId",
principalTable: "VirtualMachines",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Jobs_Deployments_DeploymentId",
table: "Jobs",
column: "DeploymentId",
principalTable: "Deployments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_QueueJobSteps_QueueJobSteps_DependsOnQueueJobStepId",
table: "QueueJobSteps",
column: "DependsOnQueueJobStepId",
principalTable: "QueueJobSteps",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_QueueJobSteps_QueueJobs_QueueJobId",
table: "QueueJobSteps",
column: "QueueJobId",
principalTable: "QueueJobs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_QueueJobTargets_QueueJobs_QueueJobId",
table: "QueueJobTargets",
column: "QueueJobId",
principalTable: "QueueJobs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,204 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
/// <inheritdoc />
public partial class RenameDeploymentAndJobColumns : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DeploymentExecutions_DeploymentBatches_DeploymentGroupId",
table: "DeploymentExecutions");
migrationBuilder.DropForeignKey(
name: "FK_DeploymentJobSteps_DeploymentJobSteps_DependsOnQueueJobStepId",
table: "DeploymentJobSteps");
migrationBuilder.DropForeignKey(
name: "FK_DeploymentJobSteps_DeploymentJobs_QueueJobId",
table: "DeploymentJobSteps");
migrationBuilder.DropForeignKey(
name: "FK_DeploymentJobTargets_DeploymentJobs_QueueJobId",
table: "DeploymentJobTargets");
migrationBuilder.RenameColumn(
name: "QueueJobId",
table: "DeploymentJobTargets",
newName: "DeploymentJobId");
migrationBuilder.RenameColumn(
name: "DeploymentGroupId",
table: "DeploymentJobTargets",
newName: "DeploymentBatchId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentJobTargets_QueueJobId",
table: "DeploymentJobTargets",
newName: "IX_DeploymentJobTargets_DeploymentJobId");
migrationBuilder.RenameColumn(
name: "QueueJobId",
table: "DeploymentJobSteps",
newName: "DeploymentJobId");
migrationBuilder.RenameColumn(
name: "DependsOnQueueJobStepId",
table: "DeploymentJobSteps",
newName: "DependsOnDeploymentJobStepId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentJobSteps_QueueJobId",
table: "DeploymentJobSteps",
newName: "IX_DeploymentJobSteps_DeploymentJobId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentJobSteps_DependsOnQueueJobStepId",
table: "DeploymentJobSteps",
newName: "IX_DeploymentJobSteps_DependsOnDeploymentJobStepId");
migrationBuilder.RenameColumn(
name: "DeploymentGroupId",
table: "DeploymentExecutions",
newName: "DeploymentBatchId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentExecutions_DeploymentGroupId",
table: "DeploymentExecutions",
newName: "IX_DeploymentExecutions_DeploymentBatchId");
migrationBuilder.AddForeignKey(
name: "FK_DeploymentExecutions_DeploymentBatches_DeploymentBatchId",
table: "DeploymentExecutions",
column: "DeploymentBatchId",
principalTable: "DeploymentBatches",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DeploymentJobSteps_DeploymentJobSteps_DependsOnDeploymentJobStepId",
table: "DeploymentJobSteps",
column: "DependsOnDeploymentJobStepId",
principalTable: "DeploymentJobSteps",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_DeploymentJobSteps_DeploymentJobs_DeploymentJobId",
table: "DeploymentJobSteps",
column: "DeploymentJobId",
principalTable: "DeploymentJobs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DeploymentJobTargets_DeploymentJobs_DeploymentJobId",
table: "DeploymentJobTargets",
column: "DeploymentJobId",
principalTable: "DeploymentJobs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DeploymentExecutions_DeploymentBatches_DeploymentBatchId",
table: "DeploymentExecutions");
migrationBuilder.DropForeignKey(
name: "FK_DeploymentJobSteps_DeploymentJobSteps_DependsOnDeploymentJobStepId",
table: "DeploymentJobSteps");
migrationBuilder.DropForeignKey(
name: "FK_DeploymentJobSteps_DeploymentJobs_DeploymentJobId",
table: "DeploymentJobSteps");
migrationBuilder.DropForeignKey(
name: "FK_DeploymentJobTargets_DeploymentJobs_DeploymentJobId",
table: "DeploymentJobTargets");
migrationBuilder.RenameColumn(
name: "DeploymentJobId",
table: "DeploymentJobTargets",
newName: "QueueJobId");
migrationBuilder.RenameColumn(
name: "DeploymentBatchId",
table: "DeploymentJobTargets",
newName: "DeploymentGroupId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentJobTargets_DeploymentJobId",
table: "DeploymentJobTargets",
newName: "IX_DeploymentJobTargets_QueueJobId");
migrationBuilder.RenameColumn(
name: "DeploymentJobId",
table: "DeploymentJobSteps",
newName: "QueueJobId");
migrationBuilder.RenameColumn(
name: "DependsOnDeploymentJobStepId",
table: "DeploymentJobSteps",
newName: "DependsOnQueueJobStepId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentJobSteps_DeploymentJobId",
table: "DeploymentJobSteps",
newName: "IX_DeploymentJobSteps_QueueJobId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentJobSteps_DependsOnDeploymentJobStepId",
table: "DeploymentJobSteps",
newName: "IX_DeploymentJobSteps_DependsOnQueueJobStepId");
migrationBuilder.RenameColumn(
name: "DeploymentBatchId",
table: "DeploymentExecutions",
newName: "DeploymentGroupId");
migrationBuilder.RenameIndex(
name: "IX_DeploymentExecutions_DeploymentBatchId",
table: "DeploymentExecutions",
newName: "IX_DeploymentExecutions_DeploymentGroupId");
migrationBuilder.AddForeignKey(
name: "FK_DeploymentExecutions_DeploymentBatches_DeploymentGroupId",
table: "DeploymentExecutions",
column: "DeploymentGroupId",
principalTable: "DeploymentBatches",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DeploymentJobSteps_DeploymentJobSteps_DependsOnQueueJobStepId",
table: "DeploymentJobSteps",
column: "DependsOnQueueJobStepId",
principalTable: "DeploymentJobSteps",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_DeploymentJobSteps_DeploymentJobs_QueueJobId",
table: "DeploymentJobSteps",
column: "QueueJobId",
principalTable: "DeploymentJobs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DeploymentJobTargets_DeploymentJobs_QueueJobId",
table: "DeploymentJobTargets",
column: "QueueJobId",
principalTable: "DeploymentJobs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@@ -17,7 +17,7 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.9")
.HasAnnotation("ProductVersion", "10.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
@@ -67,7 +67,7 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
b.HasIndex("TemplateId");
b.ToTable("DeploymentGroups");
b.ToTable("DeploymentBatches", (string)null);
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.DeploymentModel", b =>
@@ -78,6 +78,7 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
b.Property<Guid>("DeploymentGroupId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeploymentBatchId")
.HasColumnOrder(2);
b.Property<DateTime>("Created")
@@ -122,7 +123,118 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
b.HasIndex("DeploymentGroupId");
b.ToTable("Deployments");
b.ToTable("DeploymentExecutions", (string)null);
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.DeploymentRuleModel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnOrder(0)
.HasDefaultValueSql("NEWID()");
b.Property<DateTime>("Created")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
.HasColumnOrder(52)
.HasDefaultValueSql("GETDATE()");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(53);
b.Property<string>("Description")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(2);
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnOrder(3);
b.Property<DateTime>("Modified")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
.HasColumnOrder(50)
.HasDefaultValueSql("GETDATE()");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(51);
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(1);
b.HasKey("Id");
b.ToTable("DeploymentRules");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.DeploymentRuleStepModel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnOrder(0)
.HasDefaultValueSql("NEWID()");
b.Property<DateTime>("Created")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
.HasColumnOrder(52)
.HasDefaultValueSql("GETDATE()");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(53);
b.Property<Guid>("DeploymentRuleId")
.HasColumnType("uniqueidentifier")
.HasColumnOrder(1);
b.Property<string>("MetadataJson")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(6);
b.Property<DateTime>("Modified")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
.HasColumnOrder(50)
.HasDefaultValueSql("GETDATE()");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(51);
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(3);
b.Property<bool>("RequiresApproval")
.HasColumnType("bit")
.HasColumnOrder(5);
b.Property<int>("SortOrder")
.HasColumnType("int")
.HasColumnOrder(2);
b.Property<string>("StepType")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(4);
b.HasKey("Id");
b.HasIndex("DeploymentRuleId");
b.ToTable("DeploymentRuleSteps");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.DomainModel", b =>
@@ -218,10 +330,6 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
.HasColumnOrder(0)
.HasDefaultValueSql("NEWID()");
b.Property<bool>("CloudEnabled")
.HasColumnType("bit")
.HasColumnOrder(2);
b.Property<DateTime>("Created")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
@@ -233,6 +341,15 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
.HasColumnType("nvarchar(max)")
.HasColumnOrder(53);
b.Property<string>("EnvironmentType")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(2);
b.Property<string>("MetadataJson")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(6);
b.Property<DateTime>("Modified")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
@@ -249,6 +366,18 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
.HasColumnType("nvarchar(max)")
.HasColumnOrder(1);
b.Property<string>("ProviderType")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(3);
b.Property<string>("SubscriptionId")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(5);
b.Property<string>("TenantId")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(4);
b.HasKey("Id");
b.ToTable("Environments");
@@ -464,6 +593,244 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
b.ToTable("Options");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.QueueJobModel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnOrder(0)
.HasDefaultValueSql("NEWID()");
b.Property<int>("Attempts")
.HasColumnType("int")
.HasColumnOrder(4);
b.Property<DateTime>("Created")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
.HasColumnOrder(52)
.HasDefaultValueSql("GETDATE()");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(53);
b.Property<string>("ErrorMessage")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(10);
b.Property<DateTime?>("Finished")
.HasColumnType("datetime2")
.HasColumnOrder(7);
b.Property<string>("LockedBy")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(9);
b.Property<DateTime?>("LockedUntil")
.HasColumnType("datetime2")
.HasColumnOrder(8);
b.Property<int>("MaxAttempts")
.HasColumnType("int")
.HasColumnOrder(5);
b.Property<string>("MetadataJson")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(11);
b.Property<DateTime>("Modified")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
.HasColumnOrder(50)
.HasDefaultValueSql("GETDATE()");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(51);
b.Property<string>("PayloadJson")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(3);
b.Property<string>("RuleSnapshotJson")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(12);
b.Property<DateTime?>("Started")
.HasColumnType("datetime2")
.HasColumnOrder(6);
b.Property<string>("Status")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(2);
b.Property<string>("Type")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(1);
b.HasKey("Id");
b.ToTable("DeploymentJobs", (string)null);
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.QueueJobStepModel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnOrder(0)
.HasDefaultValueSql("NEWID()");
b.Property<string>("ApprovalComment")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(10);
b.Property<DateTime?>("ApprovedAt")
.HasColumnType("datetime2")
.HasColumnOrder(8);
b.Property<string>("ApprovedBy")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(9);
b.Property<DateTime>("Created")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
.HasColumnOrder(52)
.HasDefaultValueSql("GETDATE()");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(53);
b.Property<Guid?>("DependsOnQueueJobStepId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DependsOnDeploymentJobStepId")
.HasColumnOrder(2);
b.Property<string>("MetadataJson")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(7);
b.Property<DateTime>("Modified")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
.HasColumnOrder(50)
.HasDefaultValueSql("GETDATE()");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(51);
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(4);
b.Property<Guid>("QueueJobId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeploymentJobId")
.HasColumnOrder(1);
b.Property<int>("SortOrder")
.HasColumnType("int")
.HasColumnOrder(3);
b.Property<string>("Status")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(6);
b.Property<string>("StepType")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(5);
b.HasKey("Id");
b.HasIndex("DependsOnQueueJobStepId");
b.HasIndex("QueueJobId");
b.ToTable("DeploymentJobSteps", (string)null);
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.QueueJobTargetModel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnOrder(0)
.HasDefaultValueSql("NEWID()");
b.Property<int>("Attempts")
.HasColumnType("int")
.HasColumnOrder(6);
b.Property<DateTime>("Created")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
.HasColumnOrder(52)
.HasDefaultValueSql("GETDATE()");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(53);
b.Property<Guid>("DeploymentGroupId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeploymentBatchId")
.HasColumnOrder(3);
b.Property<string>("ErrorMessage")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(7);
b.Property<DateTime>("Modified")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
.HasColumnOrder(50)
.HasDefaultValueSql("GETDATE()");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(51);
b.Property<Guid>("QueueJobId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeploymentJobId")
.HasColumnOrder(1);
b.Property<string>("Status")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(5);
b.Property<Guid>("TemplateId")
.HasColumnType("uniqueidentifier")
.HasColumnOrder(4);
b.Property<Guid>("VirtualMachineId")
.HasColumnType("uniqueidentifier")
.HasColumnOrder(2);
b.HasKey("Id");
b.HasIndex("QueueJobId");
b.ToTable("DeploymentJobTargets", (string)null);
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.RunbookModel", b =>
{
b.Property<Guid>("Id")
@@ -533,6 +900,14 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
.HasColumnType("nvarchar(max)")
.HasColumnOrder(2);
b.Property<string>("IconKey")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(4);
b.Property<bool>("IsCloudService")
.HasColumnType("bit")
.HasColumnOrder(3);
b.Property<DateTime>("Modified")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
@@ -554,7 +929,7 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
b.ToTable("Services");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.TemplateCategoryModel", b =>
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.ServiceRoleDefinitionModel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -573,6 +948,73 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
.HasColumnType("nvarchar(max)")
.HasColumnOrder(53);
b.Property<string>("Description")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(4);
b.Property<string>("Key")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(2);
b.Property<DateTime>("Modified")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
.HasColumnOrder(50)
.HasDefaultValueSql("GETDATE()");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(51);
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(3);
b.Property<Guid>("ServiceId")
.HasColumnType("uniqueidentifier")
.HasColumnOrder(1);
b.HasKey("Id");
b.HasIndex("ServiceId");
b.ToTable("ServiceRoleDefinitions");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.TemplateCategoryModel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasColumnOrder(0)
.HasDefaultValueSql("NEWID()");
b.Property<string>("Color")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(5);
b.Property<DateTime>("Created")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
.HasColumnOrder(52)
.HasDefaultValueSql("GETDATE()");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(53);
b.Property<string>("Description")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(3);
b.Property<bool>("IsActive")
.HasColumnType("bit")
.HasColumnOrder(4);
b.Property<DateTime>("Modified")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
@@ -589,19 +1031,10 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
.HasColumnType("nvarchar(max)")
.HasColumnOrder(2);
b.Property<string>("ParentCategoryName")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(3);
b.Property<Guid>("ServiceId")
.HasColumnType("uniqueidentifier")
.HasColumnOrder(1);
b.Property<int>("showOrder")
.HasColumnType("int")
.HasColumnOrder(4);
b.HasKey("Id");
b.HasIndex("ServiceId");
@@ -617,10 +1050,6 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
.HasColumnOrder(0)
.HasDefaultValueSql("NEWID()");
b.Property<bool>("CloudTemplate")
.HasColumnType("bit")
.HasColumnOrder(2);
b.Property<DateTime>("Created")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
@@ -632,15 +1061,19 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
.HasColumnType("nvarchar(max)")
.HasColumnOrder(53);
b.Property<Guid?>("DeploymentRuleId")
.HasColumnType("uniqueidentifier")
.HasColumnOrder(6);
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(4);
.HasColumnOrder(3);
b.Property<string>("JSONData")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(5);
.HasColumnOrder(4);
b.Property<DateTime>("Modified")
.ValueGeneratedOnAdd()
@@ -659,15 +1092,18 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
.HasColumnOrder(1);
b.Property<Guid>("TemplateCategoryId")
.HasColumnType("uniqueidentifier");
.HasColumnType("uniqueidentifier")
.HasColumnOrder(5);
b.Property<string>("Version")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnOrder(3);
.HasColumnOrder(2);
b.HasKey("Id");
b.HasIndex("DeploymentRuleId");
b.HasIndex("TemplateCategoryId");
b.ToTable("Templates");
@@ -732,10 +1168,18 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
.HasColumnType("nvarchar(max)")
.HasColumnOrder(53);
b.Property<Guid>("DomainID")
b.Property<Guid?>("DomainID")
.HasColumnType("uniqueidentifier")
.HasColumnOrder(1);
b.Property<string>("ExternalId")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(3);
b.Property<string>("MetadataJson")
.HasColumnType("nvarchar(max)")
.HasColumnOrder(4);
b.Property<DateTime>("Modified")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2")
@@ -789,6 +1233,17 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
b.Navigation("VirtualMachine");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.DeploymentRuleStepModel", b =>
{
b.HasOne("Microsoft.SelfService.Portal.Core.API.Models.DeploymentRuleModel", "DeploymentRule")
.WithMany("Steps")
.HasForeignKey("DeploymentRuleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DeploymentRule");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.EnvironmentDomainsModel", b =>
{
b.HasOne("Microsoft.SelfService.Portal.Core.API.Models.DomainModel", "Domain")
@@ -850,6 +1305,46 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
b.Navigation("OptionCategory");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.QueueJobStepModel", b =>
{
b.HasOne("Microsoft.SelfService.Portal.Core.API.Models.QueueJobStepModel", "DependsOnQueueJobStep")
.WithMany()
.HasForeignKey("DependsOnQueueJobStepId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("Microsoft.SelfService.Portal.Core.API.Models.QueueJobModel", "QueueJob")
.WithMany("Steps")
.HasForeignKey("QueueJobId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DependsOnQueueJobStep");
b.Navigation("QueueJob");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.QueueJobTargetModel", b =>
{
b.HasOne("Microsoft.SelfService.Portal.Core.API.Models.QueueJobModel", "QueueJob")
.WithMany("Targets")
.HasForeignKey("QueueJobId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("QueueJob");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.ServiceRoleDefinitionModel", b =>
{
b.HasOne("Microsoft.SelfService.Portal.Core.API.Models.ServiceModel", "Service")
.WithMany("RoleDefinitions")
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Service");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.TemplateCategoryModel", b =>
{
b.HasOne("Microsoft.SelfService.Portal.Core.API.Models.ServiceModel", "Service")
@@ -863,12 +1358,18 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.TemplateModel", b =>
{
b.HasOne("Microsoft.SelfService.Portal.Core.API.Models.DeploymentRuleModel", "DeploymentRule")
.WithMany()
.HasForeignKey("DeploymentRuleId");
b.HasOne("Microsoft.SelfService.Portal.Core.API.Models.TemplateCategoryModel", "TemplateCategory")
.WithMany("Templates")
.HasForeignKey("TemplateCategoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DeploymentRule");
b.Navigation("TemplateCategory");
});
@@ -895,9 +1396,7 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
{
b.HasOne("Microsoft.SelfService.Portal.Core.API.Models.DomainModel", "Domain")
.WithMany("VirtualMachines")
.HasForeignKey("DomainID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("DomainID");
b.Navigation("Domain");
});
@@ -912,6 +1411,11 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
b.Navigation("Jobs");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.DeploymentRuleModel", b =>
{
b.Navigation("Steps");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.DomainModel", b =>
{
b.Navigation("EnvironmentDomains");
@@ -934,6 +1438,13 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
b.Navigation("TemplateOptions");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.QueueJobModel", b =>
{
b.Navigation("Steps");
b.Navigation("Targets");
});
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.RunbookModel", b =>
{
b.Navigation("Events");
@@ -943,6 +1454,8 @@ namespace Microsoft.SelfService.Portal.Core.API.Migrations
modelBuilder.Entity("Microsoft.SelfService.Portal.Core.API.Models.ServiceModel", b =>
{
b.Navigation("RoleDefinitions");
b.Navigation("TemplateCategories");
});