using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Diligent.WebAPI.Data.Migrations { public partial class AddedPattern : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Patterns", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Title = table.Column(type: "nvarchar(max)", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false), SelectionLevelId = table.Column(type: "int", nullable: false), Message = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Patterns", x => x.Id); table.ForeignKey( name: "FK_Patterns_SelectionLevels_SelectionLevelId", column: x => x.SelectionLevelId, principalTable: "SelectionLevels", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Patterns_SelectionLevelId", table: "Patterns", column: "SelectionLevelId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Patterns"); } } }