60 lines
1.9 KiB
C#
60 lines
1.9 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace CompanyManagment.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class addinvoicenumber : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_FinancialInvoices_FinancialStatments_FinancialStatmentid",
|
|
table: "FinancialInvoices");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_FinancialInvoices_FinancialStatmentid",
|
|
table: "FinancialInvoices");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "FinancialStatmentid",
|
|
table: "FinancialInvoices");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "InvoiceNumber",
|
|
table: "FinancialInvoices",
|
|
type: "nvarchar(18)",
|
|
maxLength: 18,
|
|
nullable: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "InvoiceNumber",
|
|
table: "FinancialInvoices");
|
|
|
|
migrationBuilder.AddColumn<long>(
|
|
name: "FinancialStatmentid",
|
|
table: "FinancialInvoices",
|
|
type: "bigint",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_FinancialInvoices_FinancialStatmentid",
|
|
table: "FinancialInvoices",
|
|
column: "FinancialStatmentid");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_FinancialInvoices_FinancialStatments_FinancialStatmentid",
|
|
table: "FinancialInvoices",
|
|
column: "FinancialStatmentid",
|
|
principalTable: "FinancialStatments",
|
|
principalColumn: "id");
|
|
}
|
|
}
|
|
}
|