using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace gehGassi.Persistence.Migrations
{
///
public partial class AppUserBlockAdded : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AppUserBlocks",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
BlockingAppUserId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
BlockedAppUserId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true),
BlockedUntil = table.Column(type: "datetimeoffset", nullable: true),
AppUserReportId = table.Column(type: "bigint", nullable: true),
CreatedBy = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
Created = table.Column(type: "datetimeoffset", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AppUserBlocks", x => x.Id);
table.ForeignKey(
name: "FK_AppUserBlocks_AppUsers_BlockedAppUserId",
column: x => x.BlockedAppUserId,
principalTable: "AppUsers",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AppUserBlocks_AppUsers_BlockingAppUserId",
column: x => x.BlockingAppUserId,
principalTable: "AppUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AppUserBlocks_BlockedAppUserId",
table: "AppUserBlocks",
column: "BlockedAppUserId");
migrationBuilder.CreateIndex(
name: "IX_AppUserBlocks_BlockingAppUserId",
table: "AppUserBlocks",
column: "BlockingAppUserId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppUserBlocks");
}
}
}