using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SharpbinV3.Server.Migrations
{
///
public partial class Reports : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Reports",
columns: table => new
{
ReportID = table.Column(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Type = table.Column(type: "INTEGER", nullable: false),
Status = table.Column(type: "INTEGER", nullable: false),
Description = table.Column(type: "TEXT", maxLength: 1000, nullable: true),
CreatedAt = table.Column(type: "INTEGER", nullable: false),
UpdatedAt = table.Column(type: "INTEGER", nullable: true),
ReporterUUID = table.Column(type: "TEXT", nullable: false),
TargetType = table.Column(type: "INTEGER", nullable: false),
PastePID = table.Column(type: "INTEGER", nullable: true),
UserUUID = table.Column(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");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Reports");
}
}
}