using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace PlumbingRepairDataBaseImplement.Migrations { /// public partial class WithMails : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Messages", columns: table => new { MessageId = table.Column(type: "text", nullable: false), ClientId = table.Column(type: "integer", nullable: true), SenderName = table.Column(type: "text", nullable: false), DateDelivery = table.Column(type: "timestamp with time zone", nullable: false), Subject = table.Column(type: "text", nullable: false), Body = table.Column(type: "text", 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"); } } }