marco.pms.api/Marco.Pms.DataAccess/Migrations/20251104095438_Added_IsExpenseCreated_In_Payment_Request_Table.cs

77 lines
2.5 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_IsExpenseCreated_In_Payment_Request_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "LatestPRGeneratedAt",
table: "RecurringPayments",
type: "datetime(6)",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime(6)");
migrationBuilder.AddColumn<bool>(
name: "IsExpenseCreated",
table: "PaymentRequests",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AlterColumn<string>(
name: "ExpenseUId",
table: "Expenses",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsExpenseCreated",
table: "PaymentRequests");
migrationBuilder.AlterColumn<DateTime>(
name: "LatestPRGeneratedAt",
table: "RecurringPayments",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true);
migrationBuilder.UpdateData(
table: "Expenses",
keyColumn: "ExpenseUId",
keyValue: null,
column: "ExpenseUId",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ExpenseUId",
table: "Expenses",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}