using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Marco.Pms.DataAccess.Migrations { /// public partial class Added_BilledTo_In_Invoice_Table : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Invoices_Projects_ProjectId", table: "Invoices"); migrationBuilder.DropIndex( name: "IX_Invoices_ProjectId", table: "Invoices"); migrationBuilder.AddColumn( name: "BilledToId", table: "Invoices", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.CreateIndex( name: "IX_Invoices_BilledToId", table: "Invoices", column: "BilledToId"); migrationBuilder.AddForeignKey( name: "FK_Invoices_Organizations_BilledToId", table: "Invoices", column: "BilledToId", principalTable: "Organizations", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Invoices_Organizations_BilledToId", table: "Invoices"); migrationBuilder.DropIndex( name: "IX_Invoices_BilledToId", table: "Invoices"); migrationBuilder.DropColumn( name: "BilledToId", table: "Invoices"); migrationBuilder.CreateIndex( name: "IX_Invoices_ProjectId", table: "Invoices", column: "ProjectId"); migrationBuilder.AddForeignKey( name: "FK_Invoices_Projects_ProjectId", table: "Invoices", column: "ProjectId", principalTable: "Projects", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }