Admin notes (#7259)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
1211
Content.Server.Database/Migrations/Postgres/20220324144654_AdminNotes.Designer.cs
generated
Normal file
1211
Content.Server.Database/Migrations/Postgres/20220324144654_AdminNotes.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,96 @@
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
public partial class AdminNotes : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "admin_notes",
|
||||
columns: table => new
|
||||
{
|
||||
admin_notes_id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
round_id = table.Column<int>(type: "integer", nullable: true),
|
||||
player_user_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
message = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
||||
created_by_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
last_edited_by_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
last_edited_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
deleted = table.Column<bool>(type: "boolean", nullable: false),
|
||||
deleted_by_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
deleted_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||
shown_to_player = table.Column<bool>(type: "boolean", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_admin_notes", x => x.admin_notes_id);
|
||||
table.ForeignKey(
|
||||
name: "FK_admin_notes_player_created_by_id",
|
||||
column: x => x.created_by_id,
|
||||
principalTable: "player",
|
||||
principalColumn: "user_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_admin_notes_player_deleted_by_id",
|
||||
column: x => x.deleted_by_id,
|
||||
principalTable: "player",
|
||||
principalColumn: "user_id");
|
||||
table.ForeignKey(
|
||||
name: "FK_admin_notes_player_last_edited_by_id",
|
||||
column: x => x.last_edited_by_id,
|
||||
principalTable: "player",
|
||||
principalColumn: "user_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_admin_notes_player_player_user_id",
|
||||
column: x => x.player_user_id,
|
||||
principalTable: "player",
|
||||
principalColumn: "user_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_admin_notes_round_round_id",
|
||||
column: x => x.round_id,
|
||||
principalTable: "round",
|
||||
principalColumn: "round_id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_admin_notes_created_by_id",
|
||||
table: "admin_notes",
|
||||
column: "created_by_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_admin_notes_deleted_by_id",
|
||||
table: "admin_notes",
|
||||
column: "deleted_by_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_admin_notes_last_edited_by_id",
|
||||
table: "admin_notes",
|
||||
column: "last_edited_by_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_admin_notes_player_user_id",
|
||||
table: "admin_notes",
|
||||
column: "player_user_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_admin_notes_round_id",
|
||||
table: "admin_notes",
|
||||
column: "round_id");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "admin_notes");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,6 +184,79 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
b.ToTable("admin_log_player", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminNote", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("admin_notes_id");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<Guid>("CreatedById")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("created_by_id");
|
||||
|
||||
b.Property<bool>("Deleted")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("deleted");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("deleted_at");
|
||||
|
||||
b.Property<Guid?>("DeletedById")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("deleted_by_id");
|
||||
|
||||
b.Property<DateTime>("LastEditedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("last_edited_at");
|
||||
|
||||
b.Property<Guid>("LastEditedById")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("last_edited_by_id");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.IsRequired()
|
||||
.HasMaxLength(4096)
|
||||
.HasColumnType("character varying(4096)")
|
||||
.HasColumnName("message");
|
||||
|
||||
b.Property<Guid>("PlayerUserId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("player_user_id");
|
||||
|
||||
b.Property<int?>("RoundId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("round_id");
|
||||
|
||||
b.Property<bool>("ShownToPlayer")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("shown_to_player");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK_admin_notes");
|
||||
|
||||
b.HasIndex("CreatedById");
|
||||
|
||||
b.HasIndex("DeletedById");
|
||||
|
||||
b.HasIndex("LastEditedById");
|
||||
|
||||
b.HasIndex("PlayerUserId")
|
||||
.HasDatabaseName("IX_admin_notes_player_user_id");
|
||||
|
||||
b.HasIndex("RoundId")
|
||||
.HasDatabaseName("IX_admin_notes_round_id");
|
||||
|
||||
b.ToTable("admin_notes", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRank", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -927,6 +1000,54 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
b.Navigation("Player");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminNote", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.Player", "CreatedBy")
|
||||
.WithMany("AdminNotesCreated")
|
||||
.HasForeignKey("CreatedById")
|
||||
.HasPrincipalKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_admin_notes_player_created_by_id");
|
||||
|
||||
b.HasOne("Content.Server.Database.Player", "DeletedBy")
|
||||
.WithMany("AdminNotesDeleted")
|
||||
.HasForeignKey("DeletedById")
|
||||
.HasPrincipalKey("UserId")
|
||||
.HasConstraintName("FK_admin_notes_player_deleted_by_id");
|
||||
|
||||
b.HasOne("Content.Server.Database.Player", "LastEditedBy")
|
||||
.WithMany("AdminNotesLastEdited")
|
||||
.HasForeignKey("LastEditedById")
|
||||
.HasPrincipalKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_admin_notes_player_last_edited_by_id");
|
||||
|
||||
b.HasOne("Content.Server.Database.Player", "Player")
|
||||
.WithMany("AdminNotesReceived")
|
||||
.HasForeignKey("PlayerUserId")
|
||||
.HasPrincipalKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_admin_notes_player_player_user_id");
|
||||
|
||||
b.HasOne("Content.Server.Database.Round", "Round")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoundId")
|
||||
.HasConstraintName("FK_admin_notes_round_round_id");
|
||||
|
||||
b.Navigation("CreatedBy");
|
||||
|
||||
b.Navigation("DeletedBy");
|
||||
|
||||
b.Navigation("LastEditedBy");
|
||||
|
||||
b.Navigation("Player");
|
||||
|
||||
b.Navigation("Round");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.AdminRank", "Rank")
|
||||
@@ -1076,6 +1197,14 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
modelBuilder.Entity("Content.Server.Database.Player", b =>
|
||||
{
|
||||
b.Navigation("AdminLogs");
|
||||
|
||||
b.Navigation("AdminNotesCreated");
|
||||
|
||||
b.Navigation("AdminNotesDeleted");
|
||||
|
||||
b.Navigation("AdminNotesLastEdited");
|
||||
|
||||
b.Navigation("AdminNotesReceived");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Preference", b =>
|
||||
|
||||
1153
Content.Server.Database/Migrations/Sqlite/20220324144649_AdminNotes.Designer.cs
generated
Normal file
1153
Content.Server.Database/Migrations/Sqlite/20220324144649_AdminNotes.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,95 @@
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
public partial class AdminNotes : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "admin_notes",
|
||||
columns: table => new
|
||||
{
|
||||
admin_notes_id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
round_id = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
player_user_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
message = table.Column<string>(type: "TEXT", maxLength: 4096, nullable: false),
|
||||
created_by_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
created_at = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
last_edited_by_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
last_edited_at = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
deleted = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
deleted_by_id = table.Column<Guid>(type: "TEXT", nullable: true),
|
||||
deleted_at = table.Column<DateTime>(type: "TEXT", nullable: true),
|
||||
shown_to_player = table.Column<bool>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_admin_notes", x => x.admin_notes_id);
|
||||
table.ForeignKey(
|
||||
name: "FK_admin_notes_player_created_by_id",
|
||||
column: x => x.created_by_id,
|
||||
principalTable: "player",
|
||||
principalColumn: "user_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_admin_notes_player_deleted_by_id",
|
||||
column: x => x.deleted_by_id,
|
||||
principalTable: "player",
|
||||
principalColumn: "user_id");
|
||||
table.ForeignKey(
|
||||
name: "FK_admin_notes_player_last_edited_by_id",
|
||||
column: x => x.last_edited_by_id,
|
||||
principalTable: "player",
|
||||
principalColumn: "user_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_admin_notes_player_player_user_id",
|
||||
column: x => x.player_user_id,
|
||||
principalTable: "player",
|
||||
principalColumn: "user_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_admin_notes_round_round_id",
|
||||
column: x => x.round_id,
|
||||
principalTable: "round",
|
||||
principalColumn: "round_id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_admin_notes_created_by_id",
|
||||
table: "admin_notes",
|
||||
column: "created_by_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_admin_notes_deleted_by_id",
|
||||
table: "admin_notes",
|
||||
column: "deleted_by_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_admin_notes_last_edited_by_id",
|
||||
table: "admin_notes",
|
||||
column: "last_edited_by_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_admin_notes_player_user_id",
|
||||
table: "admin_notes",
|
||||
column: "player_user_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_admin_notes_round_id",
|
||||
table: "admin_notes",
|
||||
column: "round_id");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "admin_notes");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,6 +168,77 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
b.ToTable("admin_log_player", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminNote", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("admin_notes_id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<Guid>("CreatedById")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_by_id");
|
||||
|
||||
b.Property<bool>("Deleted")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("deleted");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("deleted_at");
|
||||
|
||||
b.Property<Guid?>("DeletedById")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("deleted_by_id");
|
||||
|
||||
b.Property<DateTime>("LastEditedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_edited_at");
|
||||
|
||||
b.Property<Guid>("LastEditedById")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_edited_by_id");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.IsRequired()
|
||||
.HasMaxLength(4096)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("message");
|
||||
|
||||
b.Property<Guid>("PlayerUserId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("player_user_id");
|
||||
|
||||
b.Property<int?>("RoundId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("round_id");
|
||||
|
||||
b.Property<bool>("ShownToPlayer")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("shown_to_player");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK_admin_notes");
|
||||
|
||||
b.HasIndex("CreatedById");
|
||||
|
||||
b.HasIndex("DeletedById");
|
||||
|
||||
b.HasIndex("LastEditedById");
|
||||
|
||||
b.HasIndex("PlayerUserId")
|
||||
.HasDatabaseName("IX_admin_notes_player_user_id");
|
||||
|
||||
b.HasIndex("RoundId")
|
||||
.HasDatabaseName("IX_admin_notes_round_id");
|
||||
|
||||
b.ToTable("admin_notes", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRank", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -869,6 +940,54 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
b.Navigation("Player");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminNote", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.Player", "CreatedBy")
|
||||
.WithMany("AdminNotesCreated")
|
||||
.HasForeignKey("CreatedById")
|
||||
.HasPrincipalKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_admin_notes_player_created_by_id");
|
||||
|
||||
b.HasOne("Content.Server.Database.Player", "DeletedBy")
|
||||
.WithMany("AdminNotesDeleted")
|
||||
.HasForeignKey("DeletedById")
|
||||
.HasPrincipalKey("UserId")
|
||||
.HasConstraintName("FK_admin_notes_player_deleted_by_id");
|
||||
|
||||
b.HasOne("Content.Server.Database.Player", "LastEditedBy")
|
||||
.WithMany("AdminNotesLastEdited")
|
||||
.HasForeignKey("LastEditedById")
|
||||
.HasPrincipalKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_admin_notes_player_last_edited_by_id");
|
||||
|
||||
b.HasOne("Content.Server.Database.Player", "Player")
|
||||
.WithMany("AdminNotesReceived")
|
||||
.HasForeignKey("PlayerUserId")
|
||||
.HasPrincipalKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_admin_notes_player_player_user_id");
|
||||
|
||||
b.HasOne("Content.Server.Database.Round", "Round")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoundId")
|
||||
.HasConstraintName("FK_admin_notes_round_round_id");
|
||||
|
||||
b.Navigation("CreatedBy");
|
||||
|
||||
b.Navigation("DeletedBy");
|
||||
|
||||
b.Navigation("LastEditedBy");
|
||||
|
||||
b.Navigation("Player");
|
||||
|
||||
b.Navigation("Round");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.AdminRank", "Rank")
|
||||
@@ -1018,6 +1137,14 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
modelBuilder.Entity("Content.Server.Database.Player", b =>
|
||||
{
|
||||
b.Navigation("AdminLogs");
|
||||
|
||||
b.Navigation("AdminNotesCreated");
|
||||
|
||||
b.Navigation("AdminNotesDeleted");
|
||||
|
||||
b.Navigation("AdminNotesLastEdited");
|
||||
|
||||
b.Navigation("AdminNotesReceived");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Preference", b =>
|
||||
|
||||
Reference in New Issue
Block a user