🗃️ 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:
2364
DysonNetwork.Sphere/Migrations/20250503032932_AddChatMessageNonce.Designer.cs
generated
Normal file
2364
DysonNetwork.Sphere/Migrations/20250503032932_AddChatMessageNonce.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
2359
DysonNetwork.Sphere/Migrations/20250503040922_DontKnowHowToNameThing2.Designer.cs
generated
Normal file
2359
DysonNetwork.Sphere/Migrations/20250503040922_DontKnowHowToNameThing2.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,48 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DysonNetwork.Sphere.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class DontKnowHowToNameThing2 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "type",
|
||||
table: "chat_messages");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "nonce",
|
||||
table: "chat_messages",
|
||||
type: "character varying(36)",
|
||||
maxLength: 36,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "text");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "nonce",
|
||||
table: "chat_messages",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "character varying(36)",
|
||||
oldMaxLength: 36);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "type",
|
||||
table: "chat_messages",
|
||||
type: "character varying(1024)",
|
||||
maxLength: 1024,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
}
|
||||
}
|
@ -806,14 +806,20 @@ namespace DysonNetwork.Sphere.Migrations
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("forwarded_message_id");
|
||||
|
||||
b.Property<List<Guid>>("MembersMetioned")
|
||||
b.Property<List<Guid>>("MembersMentioned")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("members_metioned");
|
||||
.HasColumnName("members_mentioned");
|
||||
|
||||
b.Property<Dictionary<string, object>>("Meta")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("meta");
|
||||
|
||||
b.Property<string>("Nonce")
|
||||
.IsRequired()
|
||||
.HasMaxLength(36)
|
||||
.HasColumnType("character varying(36)")
|
||||
.HasColumnName("nonce");
|
||||
|
||||
b.Property<Guid?>("RepliedMessageId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("replied_message_id");
|
||||
@ -822,12 +828,6 @@ namespace DysonNetwork.Sphere.Migrations
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("sender_id");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1024)
|
||||
.HasColumnType("character varying(1024)")
|
||||
.HasColumnName("type");
|
||||
|
||||
b.Property<Instant>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("updated_at");
|
||||
|
Reference in New Issue
Block a user