1
0
mirror of synced 2024-11-28 00:20:53 +01:00
TaikoLocalServer/GameDatabase/Migrations/20231111155016_CopyPasswordSaltFromCardToCredential.cs

31 lines
910 B
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace GameDatabase.Migrations
{
/// <inheritdoc />
public partial class CopyPasswordSaltFromCardToCredential : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(@"
INSERT INTO Credential (Baid, Password, Salt)
SELECT Baid, Password, Salt
FROM Card
");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(@"
UPDATE Card
SET Password = (SELECT Password FROM Credential WHERE Credential.Baid = Card.Baid),
Salt = (SELECT Salt FROM Credential WHERE Credential.Baid = Card.Baid)
");
}
}
}