Skip to content

Commit

Permalink
Added M003FixDefaults.cs - a default value bug in Block.Accounted and…
Browse files Browse the repository at this point in the history
… Payment.Completed table - fixes #533.
  • Loading branch information
bonesoul committed Oct 24, 2014
1 parent f4d88df commit f2c0b74
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/CoiniumServ/CoiniumServ.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
<Compile Include="Coin\Config\CoinOptions.cs" />
<Compile Include="Coin\Config\IBlockExplorerOptions.cs" />
<Compile Include="Coin\Config\ICoinOptions.cs" />
<Compile Include="Persistance\Layers\Hybrid\Migrations\M003FixDefaults.cs" />
<Compile Include="Server\Web\Modules\TosModule.cs" />
<Compile Include="Utils\Helpers\Humanize.cs" />
<Compile Include="Configuration\IJsonConfigReader.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#region License
//
// CoiniumServ - Crypto Currency Mining Pool Server Software
// Copyright (C) 2013 - 2014, CoiniumServ Project - http://www.coinium.org
// http://www.coiniumserv.com - https://github.com/CoiniumServ/CoiniumServ
//
// This software is dual-licensed: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// For the terms of this license, see licenses/gpl_v3.txt.
//
// Alternatively, you can license this software under a commercial
// license or white-label it as set out in licenses/commercial.txt.
//
#endregion

using FluentMigrator;

namespace CoiniumServ.Persistance.Layers.Hybrid.Migrations
{
/// <summary>
/// Fixes a bug in M002Payment.cs where default values for Block.Accounted and Payment.Completed was not set.
/// </summary>
[Migration(20141024)]
public class M003FixDefaults : Migration
{
public override void Up()
{
Alter.Table("Block").AlterColumn("Accounted").AsBoolean().NotNullable().WithDefaultValue("0"); // let Block.Accounted have default value of 0.
Alter.Table("Payment").AlterColumn("Completed").AsBoolean().NotNullable().WithDefaultValue("0"); // let Payment.Completed have default value of 0.
}

public override void Down()
{
throw new System.NotImplementedException();
}
}
}

0 comments on commit f2c0b74

Please sign in to comment.