using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Microsoft.SelfService.Portal.Core.API.Migrations { /// public partial class AddServiceCloudFlagAndRoleDefinitionsV2 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "IsCloudService", table: "Services", type: "bit", nullable: false, defaultValue: false) .Annotation("Relational:ColumnOrder", 3); migrationBuilder.CreateTable( name: "ServiceRoleDefinitions", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"), ServiceId = table.Column(type: "uniqueidentifier", nullable: false), Key = table.Column(type: "nvarchar(max)", nullable: false), Name = table.Column(type: "nvarchar(max)", nullable: false), Description = table.Column(type: "nvarchar(max)", nullable: true), MinCount = table.Column(type: "int", nullable: false), MaxCount = table.Column(type: "int", nullable: false), DefaultStageOrder = table.Column(type: "int", nullable: false), Modified = table.Column(type: "datetime2", nullable: false, defaultValueSql: "GETDATE()"), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: false), Created = table.Column(type: "datetime2", nullable: false, defaultValueSql: "GETDATE()"), CreatedBy = table.Column(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"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ServiceRoleDefinitions"); migrationBuilder.DropColumn( name: "IsCloudService", table: "Services"); } } }