BudgetApp/BudgetApp.Storage/Migrations/20251030001445_Transactions.cs
Martin Svrcina e14e552388 Initial commit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 01:52:43 +01:00

97 lines
3.0 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BudgetApp.Storage.Migrations
{
/// <inheritdoc />
public partial class Transactions : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<decimal>(
name: "Amount",
table: "Transactions",
type: "decimal(65,30)",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<decimal>(
name: "Balance",
table: "Transactions",
type: "decimal(65,30)",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<string>(
name: "Category",
table: "Transactions",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<DateOnly>(
name: "Date",
table: "Transactions",
type: "date",
nullable: false,
defaultValue: new DateOnly(1, 1, 1));
migrationBuilder.AddColumn<string>(
name: "Note",
table: "Transactions",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "OperationDescription",
table: "Transactions",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "TransactionId",
table: "Transactions",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Amount",
table: "Transactions");
migrationBuilder.DropColumn(
name: "Balance",
table: "Transactions");
migrationBuilder.DropColumn(
name: "Category",
table: "Transactions");
migrationBuilder.DropColumn(
name: "Date",
table: "Transactions");
migrationBuilder.DropColumn(
name: "Note",
table: "Transactions");
migrationBuilder.DropColumn(
name: "OperationDescription",
table: "Transactions");
migrationBuilder.DropColumn(
name: "TransactionId",
table: "Transactions");
}
}
}