Swarm/DysonNetwork.Sphere/Migrations/20250502174318_DontKnowHowToNameThing.cs
LittleSheep f6acb3f2f0 🗑️ remove Casbin dependency and related configurations
Remove Casbin package references, configurations, and unused imports across multiple files. This change simplifies the codebase by eliminating unnecessary dependencies and reducing complexity.

 add new chat features and improve message handling

Introduce new chat features including message notifications, nicknames, and improved message handling. Enhance the WebSocket service to support new packet handlers and improve message delivery.

🗃️ add new migrations for chat-related changes

Add new migrations to support the latest chat features, including changes to chat members, messages, and reactions. These migrations ensure the database schema is up-to-date with the latest code changes.
2025-05-03 02:02:16 +08:00

63 lines
2.0 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
using NpgsqlTypes;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class DontKnowHowToNameThing : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<NpgsqlTsVector>(
name: "search_vector",
table: "posts",
type: "tsvector",
nullable: true,
oldClrType: typeof(NpgsqlTsVector),
oldType: "tsvector")
.OldAnnotation("Npgsql:TsVectorConfig", "simple")
.OldAnnotation("Npgsql:TsVectorProperties", new[] { "title", "description", "content" });
migrationBuilder.AddColumn<string>(
name: "nick",
table: "chat_members",
type: "character varying(1024)",
maxLength: 1024,
nullable: true);
migrationBuilder.AddColumn<int>(
name: "notify",
table: "chat_members",
type: "integer",
nullable: false,
defaultValue: 0);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "nick",
table: "chat_members");
migrationBuilder.DropColumn(
name: "notify",
table: "chat_members");
migrationBuilder.AlterColumn<NpgsqlTsVector>(
name: "search_vector",
table: "posts",
type: "tsvector",
nullable: false,
oldClrType: typeof(NpgsqlTsVector),
oldType: "tsvector",
oldNullable: true)
.Annotation("Npgsql:TsVectorConfig", "simple")
.Annotation("Npgsql:TsVectorProperties", new[] { "title", "description", "content" });
}
}
}