🗃️ 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.
This commit is contained in:
@ -0,0 +1,39 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user