85 lines
3.2 KiB
C#
85 lines
3.2 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Marco.Pms.DataAccess.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Added_Status_In_PurchaseInvoiceDetails_Table : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "StatusId",
|
|
table: "PurchaseInvoiceDetails",
|
|
type: "char(36)",
|
|
nullable: false,
|
|
defaultValue: new Guid("8a5ef25e-3c9e-45de-add9-6b1c1df54381"),
|
|
collation: "ascii_general_ci");
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "InvoiceAttachmentTypeId",
|
|
table: "PurchaseInvoiceAttachments",
|
|
type: "char(36)",
|
|
nullable: false,
|
|
defaultValue: new Guid("3ca08288-0a74-4850-9948-0783aa975b84"),
|
|
collation: "ascii_general_ci");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_PurchaseInvoiceDetails_StatusId",
|
|
table: "PurchaseInvoiceDetails",
|
|
column: "StatusId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_PurchaseInvoiceAttachments_InvoiceAttachmentTypeId",
|
|
table: "PurchaseInvoiceAttachments",
|
|
column: "InvoiceAttachmentTypeId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_PurchaseInvoiceAttachments_InvoiceAttachmentTypes_InvoiceAtt~",
|
|
table: "PurchaseInvoiceAttachments",
|
|
column: "InvoiceAttachmentTypeId",
|
|
principalTable: "InvoiceAttachmentTypes",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_PurchaseInvoiceDetails_PurchaseInvoiceStatus_StatusId",
|
|
table: "PurchaseInvoiceDetails",
|
|
column: "StatusId",
|
|
principalTable: "PurchaseInvoiceStatus",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_PurchaseInvoiceAttachments_InvoiceAttachmentTypes_InvoiceAtt~",
|
|
table: "PurchaseInvoiceAttachments");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_PurchaseInvoiceDetails_PurchaseInvoiceStatus_StatusId",
|
|
table: "PurchaseInvoiceDetails");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_PurchaseInvoiceDetails_StatusId",
|
|
table: "PurchaseInvoiceDetails");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_PurchaseInvoiceAttachments_InvoiceAttachmentTypeId",
|
|
table: "PurchaseInvoiceAttachments");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "StatusId",
|
|
table: "PurchaseInvoiceDetails");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "InvoiceAttachmentTypeId",
|
|
table: "PurchaseInvoiceAttachments");
|
|
}
|
|
}
|
|
}
|