forked from SoDOff-Project/sodoff
make `ToVikingId
` nullable for system messages
This commit is contained in:
parent
b7b99cd353
commit
6c31296d3b
1317
src/Migrations/20250306194521_Messaging_ToVikingIdNullable.Designer.cs
generated
Normal file
1317
src/Migrations/20250306194521_Messaging_ToVikingIdNullable.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,59 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace sodoff.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Messaging_ToVikingIdNullable : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Messages_Vikings_ToVikingId",
|
||||
table: "Messages");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "ToVikingId",
|
||||
table: "Messages",
|
||||
type: "INTEGER",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Messages_Vikings_ToVikingId",
|
||||
table: "Messages",
|
||||
column: "ToVikingId",
|
||||
principalTable: "Vikings",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Messages_Vikings_ToVikingId",
|
||||
table: "Messages");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "ToVikingId",
|
||||
table: "Messages",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Messages_Vikings_ToVikingId",
|
||||
table: "Messages",
|
||||
column: "ToVikingId",
|
||||
principalTable: "Vikings",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
@ -343,7 +343,7 @@ namespace sodoff.Migrations
|
||||
b.Property<int>("QueueID")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ToVikingId")
|
||||
b.Property<int?>("ToVikingId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("VikingId")
|
||||
@ -982,9 +982,7 @@ namespace sodoff.Migrations
|
||||
|
||||
b.HasOne("sodoff.Model.Viking", "ToViking")
|
||||
.WithMany("MessageBoard")
|
||||
.HasForeignKey("ToVikingId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
.HasForeignKey("ToVikingId");
|
||||
|
||||
b.HasOne("sodoff.Model.Viking", "Viking")
|
||||
.WithMany("MessagesMade")
|
||||
|
@ -10,7 +10,7 @@ public class Message
|
||||
public int Id { get; set; }
|
||||
|
||||
public int VikingId { get; set; }
|
||||
public int ToVikingId { get; set; }
|
||||
public int? ToVikingId { get; set; }
|
||||
|
||||
public int QueueID { get; set; }
|
||||
public int? ConversationID { get; set; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user