using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace RadicadeServer.Migrations { public partial class BanSystemComplete : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "LastIpAddress", table: "Players", type: "nvarchar(max)", nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "BanMethod", table: "Moderation", type: "nvarchar(max)", nullable: false, defaultValue: "None"); migrationBuilder.CreateTable( name: "HardwareBans", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), DeviceId = table.Column(type: "nvarchar(max)", nullable: false), Reason = table.Column(type: "nvarchar(max)", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false), ExpiresAt = table.Column(type: "datetime2", nullable: true) }, constraints: table => { table.PrimaryKey("PK_HardwareBans", x => x.Id); }); migrationBuilder.CreateTable( name: "IpBans", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), IpAddress = table.Column(type: "nvarchar(max)", nullable: false), Reason = table.Column(type: "nvarchar(max)", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false), ExpiresAt = table.Column(type: "datetime2", nullable: true) }, constraints: table => { table.PrimaryKey("PK_IpBans", x => x.Id); }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "HardwareBans"); migrationBuilder.DropTable( name: "IpBans"); migrationBuilder.DropColumn( name: "LastIpAddress", table: "Players"); migrationBuilder.DropColumn( name: "BanMethod", table: "Moderation"); } } }