mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-05 18:48:41 +00:00
refactor: change jwt claims to lowercase; use response dtos for sensitive data fix: nullify user on token clears; change appsettings.dev View_Internal_API_Key
81 lines
3.1 KiB
C#
81 lines
3.1 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace SharpbinV3.Server.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Reports : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Reports",
|
|
columns: table => new
|
|
{
|
|
ReportID = table.Column<int>(type: "INTEGER", nullable: false)
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
Type = table.Column<int>(type: "INTEGER", nullable: false),
|
|
Status = table.Column<int>(type: "INTEGER", nullable: false),
|
|
Description = table.Column<string>(type: "TEXT", maxLength: 1000, nullable: true),
|
|
CreatedAt = table.Column<long>(type: "INTEGER", nullable: false),
|
|
UpdatedAt = table.Column<long>(type: "INTEGER", nullable: true),
|
|
ReporterUUID = table.Column<Guid>(type: "TEXT", nullable: false),
|
|
TargetType = table.Column<int>(type: "INTEGER", nullable: false),
|
|
PastePID = table.Column<int>(type: "INTEGER", nullable: true),
|
|
UserUUID = table.Column<Guid>(type: "TEXT", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Reports", x => x.ReportID);
|
|
table.ForeignKey(
|
|
name: "FK_Reports_Pastes_PastePID",
|
|
column: x => x.PastePID,
|
|
principalTable: "Pastes",
|
|
principalColumn: "PID",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "FK_Reports_Users_UserUUID",
|
|
column: x => x.UserUUID,
|
|
principalTable: "Users",
|
|
principalColumn: "UUID",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Reports_PastePID",
|
|
table: "Reports",
|
|
column: "PastePID");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Reports_ReporterUUID",
|
|
table: "Reports",
|
|
column: "ReporterUUID");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Reports_ReportID",
|
|
table: "Reports",
|
|
column: "ReportID",
|
|
unique: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Reports_TargetType",
|
|
table: "Reports",
|
|
column: "TargetType");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Reports_UserUUID",
|
|
table: "Reports",
|
|
column: "UserUUID");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Reports");
|
|
}
|
|
}
|
|
}
|