Skip to content

Commit

Permalink
Merge pull request #36 from MeikelLP/fix/empire-migration
Browse files Browse the repository at this point in the history
Fix/empire migration
  • Loading branch information
MeikelLP authored Nov 16, 2023
2 parents ebbb128 + b1ecc78 commit eedbbfa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Executables/Game/PacketHandlers/Select/EmpireHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public async Task ExecuteAsync(GamePacketContext<Empire> ctx, CancellationToken
{
if (ctx.Packet.EmpireId is > 0 and < 4)
{
var result = await _db.ExecuteAsync("UPDATE accounts set Empire = @Empire WHERE Id = @AccountId"
var result = await _db.ExecuteAsync("UPDATE account.accounts set Empire = @Empire WHERE Id = @AccountId"
, new { AccountId = ctx.Connection.AccountId, Empire = ctx.Packet.EmpireId });
if (result is not 1)
{
Expand All @@ -34,4 +34,4 @@ public async Task ExecuteAsync(GamePacketContext<Empire> ctx, CancellationToken
_logger.LogWarning("Unexpected empire choice {Empire}", ctx.Packet.EmpireId);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FluentMigrator;

namespace QuantumCore.Migrations
{
[Tags("account")]
[Migration(20231101165500)]
public class AlterAccountAddEmpire : Migration
{
public override void Up()
{
Alter.Table("accounts").AddColumn("Empire").AsByte().WithDefaultValue(0);
}

public override void Down()
{
Delete.Column("Empire").FromTable("accounts");
}
}
}

0 comments on commit eedbbfa

Please sign in to comment.