using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace InventoryManagement.Migrations { /// public partial class accessary : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Accessaries", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ProductId = table.Column(type: "int", nullable: false), Name = table.Column(type: "nvarchar(max)", nullable: false), Description = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Accessaries", x => x.Id); table.ForeignKey( name: "FK_Accessaries_Products_ProductId", column: x => x.ProductId, principalTable: "Products", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Accessaries_ProductId", table: "Accessaries", column: "ProductId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Accessaries"); } } }