Skip to content

Commit

Permalink
Database migration: 'ConvertToCurrency' column
Browse files Browse the repository at this point in the history
  • Loading branch information
Marfusios committed Jul 17, 2024
1 parent 349f3f1 commit 352d5a3
Show file tree
Hide file tree
Showing 3 changed files with 220 additions and 0 deletions.
169 changes: 169 additions & 0 deletions plugin/Migrations/20240717145506_ConvertToCurrency.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions plugin/Migrations/20240717145506_ConvertToCurrency.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BTCPayServer.Plugins.Strike.Migrations
{
/// <inheritdoc />
public partial class ConvertToCurrency : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ConvertToCurrency",
schema: "BTCPayServer.Plugins.Strike",
table: "Quotes",
type: "character varying(10)",
maxLength: 10,
nullable: true);

migrationBuilder.AddColumn<bool>(
name: "Converted",
schema: "BTCPayServer.Plugins.Strike",
table: "Quotes",
type: "boolean",
nullable: false,
defaultValue: false);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ConvertToCurrency",
schema: "BTCPayServer.Plugins.Strike",
table: "Quotes");

migrationBuilder.DropColumn(
name: "Converted",
schema: "BTCPayServer.Plugins.Strike",
table: "Quotes");
}
}
}
7 changes: 7 additions & 0 deletions plugin/Migrations/StrikeDbContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<decimal>("ConversionRate")
.HasColumnType("numeric");

b.Property<string>("ConvertToCurrency")
.HasMaxLength(10)
.HasColumnType("character varying(10)");

b.Property<bool>("Converted")
.HasColumnType("boolean");

b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");

Expand Down

0 comments on commit 352d5a3

Please sign in to comment.