warrenchen 33102d536e feat: Implement email blacklist functionality and completed auth for subscription sending flow
- Added EmailBlacklist service and controller for managing blacklisted emails.
- Created EmailBlacklistDto for data transfer and EmailBlacklistFormViewModel for form handling.
- Implemented views for listing and adding emails to the blacklist.
- Updated database schema with new EmailBlacklist entity and related migrations.
- Enhanced OAuthClientFormViewModel to include ClientId and ClientSecret properties.
- Added EmailBlacklistService to handle email blacklisting logic.
- Integrated email blacklist service into the application with necessary dependencies.
2026-02-10 18:05:03 +09:00

72 lines
2.4 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MemberCenter.Infrastructure.Persistence.Migrations
{
public partial class AddEmailBlacklist : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsBlacklisted",
table: "users",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<DateTimeOffset>(
name: "BlacklistedAt",
table: "users",
type: "timestamp with time zone",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "BlacklistedBy",
table: "users",
type: "text",
nullable: true);
migrationBuilder.CreateTable(
name: "email_blacklist",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Email = table.Column<string>(type: "text", nullable: false),
Reason = table.Column<string>(type: "text", nullable: false),
BlacklistedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"),
BlacklistedBy = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_email_blacklist", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_email_blacklist_Email",
table: "email_blacklist",
column: "Email",
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "email_blacklist");
migrationBuilder.DropColumn(
name: "IsBlacklisted",
table: "users");
migrationBuilder.DropColumn(
name: "BlacklistedAt",
table: "users");
migrationBuilder.DropColumn(
name: "BlacklistedBy",
table: "users");
}
}
}