61 lines
2.0 KiB
C#
61 lines
2.0 KiB
C#
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace Infrastructure.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class fixChangeRecord : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropForeignKey(
|
|||
|
name: "FK_ChangeRecords_SpendingGroups_SpendingGroupId",
|
|||
|
table: "ChangeRecords");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<Guid>(
|
|||
|
name: "SpendingGroupId",
|
|||
|
table: "ChangeRecords",
|
|||
|
type: "uuid",
|
|||
|
nullable: true,
|
|||
|
oldClrType: typeof(Guid),
|
|||
|
oldType: "uuid");
|
|||
|
|
|||
|
migrationBuilder.AddForeignKey(
|
|||
|
name: "FK_ChangeRecords_SpendingGroups_SpendingGroupId",
|
|||
|
table: "ChangeRecords",
|
|||
|
column: "SpendingGroupId",
|
|||
|
principalTable: "SpendingGroups",
|
|||
|
principalColumn: "Id");
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropForeignKey(
|
|||
|
name: "FK_ChangeRecords_SpendingGroups_SpendingGroupId",
|
|||
|
table: "ChangeRecords");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<Guid>(
|
|||
|
name: "SpendingGroupId",
|
|||
|
table: "ChangeRecords",
|
|||
|
type: "uuid",
|
|||
|
nullable: false,
|
|||
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
|||
|
oldClrType: typeof(Guid),
|
|||
|
oldType: "uuid",
|
|||
|
oldNullable: true);
|
|||
|
|
|||
|
migrationBuilder.AddForeignKey(
|
|||
|
name: "FK_ChangeRecords_SpendingGroups_SpendingGroupId",
|
|||
|
table: "ChangeRecords",
|
|||
|
column: "SpendingGroupId",
|
|||
|
principalTable: "SpendingGroups",
|
|||
|
principalColumn: "Id",
|
|||
|
onDelete: ReferentialAction.Cascade);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|