using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace ElectronicsShopDataBaseImplement.Migrations { /// public partial class AddMessages : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Messages", columns: table => new { MessageID = table.Column(type: "nvarchar(450)", nullable: false), ClientID = table.Column(type: "int", nullable: true), SenderName = table.Column(type: "nvarchar(max)", nullable: false), DateDelivery = table.Column(type: "datetime2", nullable: false), Subject = table.Column(type: "nvarchar(max)", nullable: false), Body = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Messages", x => x.MessageID); table.ForeignKey( name: "FK_Messages_Clients_ClientID", column: x => x.ClientID, principalTable: "Clients", principalColumn: "ID"); }); migrationBuilder.CreateIndex( name: "IX_Messages_ClientID", table: "Messages", column: "ClientID"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Messages"); } } }