using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
///
public partial class Added_ProjectId_In_PaymentRequest_RecurringPayment_Tables : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "ProjectId",
table: "RecurringPayments",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn(
name: "ProjectId",
table: "PaymentRequests",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_RecurringPayments_ProjectId",
table: "RecurringPayments",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_PaymentRequests_ProjectId",
table: "PaymentRequests",
column: "ProjectId");
migrationBuilder.AddForeignKey(
name: "FK_PaymentRequests_Projects_ProjectId",
table: "PaymentRequests",
column: "ProjectId",
principalTable: "Projects",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_RecurringPayments_Projects_ProjectId",
table: "RecurringPayments",
column: "ProjectId",
principalTable: "Projects",
principalColumn: "Id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PaymentRequests_Projects_ProjectId",
table: "PaymentRequests");
migrationBuilder.DropForeignKey(
name: "FK_RecurringPayments_Projects_ProjectId",
table: "RecurringPayments");
migrationBuilder.DropIndex(
name: "IX_RecurringPayments_ProjectId",
table: "RecurringPayments");
migrationBuilder.DropIndex(
name: "IX_PaymentRequests_ProjectId",
table: "PaymentRequests");
migrationBuilder.DropColumn(
name: "ProjectId",
table: "RecurringPayments");
migrationBuilder.DropColumn(
name: "ProjectId",
table: "PaymentRequests");
}
}
}