Swarm/DysonNetwork.Sphere/Migrations/20250503032932_AddChatMessageNonce.cs
LittleSheep 196547e50f 🗃️ Add nonce column to chat messages and fix column typo
This migration adds a new "nonce" column to the "chat_messages" table to ensure message uniqueness or integrity. Additionally, it corrects a typo in the "members_mentioned" column name to improve consistency and clarity.
2025-05-03 13:16:18 +08:00

40 lines
1.1 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class AddChatMessageNonce : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "members_metioned",
table: "chat_messages",
newName: "members_mentioned");
migrationBuilder.AddColumn<string>(
name: "nonce",
table: "chat_messages",
type: "text",
nullable: false,
defaultValue: "");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "nonce",
table: "chat_messages");
migrationBuilder.RenameColumn(
name: "members_mentioned",
table: "chat_messages",
newName: "members_metioned");
}
}
}