using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace DorkNet.Server.Migrations { /// public partial class Phase9ReportsAndIpBans : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "IpBans", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Cidr = table.Column(type: "TEXT", maxLength: 64, nullable: false), Reason = table.Column(type: "TEXT", maxLength: 512, nullable: false), BannedByAdminId = table.Column(type: "INTEGER", nullable: false), BannedAt = table.Column(type: "TEXT", nullable: false), Until = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_IpBans", x => x.Id); }); migrationBuilder.CreateTable( name: "Reports", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), ReporterPlayerId = table.Column(type: "INTEGER", nullable: false), TargetPlayerId = table.Column(type: "INTEGER", nullable: false), Category = table.Column(type: "INTEGER", nullable: false), Message = table.Column(type: "TEXT", maxLength: 1000, nullable: false), GameSessionId = table.Column(type: "INTEGER", nullable: false), RoomId = table.Column(type: "INTEGER", nullable: false), CreatedAt = table.Column(type: "TEXT", nullable: false), ResolvedAt = table.Column(type: "TEXT", nullable: true), ResolverAdminId = table.Column(type: "INTEGER", nullable: true), ResolutionNote = table.Column(type: "TEXT", maxLength: 512, nullable: false) }, constraints: table => { table.PrimaryKey("PK_Reports", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_IpBans_Cidr", table: "IpBans", column: "Cidr"); migrationBuilder.CreateIndex( name: "IX_Reports_ReporterPlayerId", table: "Reports", column: "ReporterPlayerId"); migrationBuilder.CreateIndex( name: "IX_Reports_ResolvedAt", table: "Reports", column: "ResolvedAt"); migrationBuilder.CreateIndex( name: "IX_Reports_TargetPlayerId", table: "Reports", column: "TargetPlayerId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "IpBans"); migrationBuilder.DropTable( name: "Reports"); } } }