using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Nuuru.Server.Migrations { /// public partial class AddIpBans : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "IpBans", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), IpAddress = table.Column(type: "TEXT", maxLength: 45, nullable: false), Reason = table.Column(type: "TEXT", nullable: true), StartTime = table.Column(type: "TEXT", nullable: false), EndTime = table.Column(type: "TEXT", nullable: false), Active = table.Column(type: "INTEGER", nullable: false), CreatedById = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_IpBans", x => x.Id); table.ForeignKey( name: "FK_IpBans_AspNetUsers_CreatedById", column: x => x.CreatedById, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }); migrationBuilder.CreateIndex( name: "IX_IpBans_Active_EndTime", table: "IpBans", columns: new[] { "Active", "EndTime" }); migrationBuilder.CreateIndex( name: "IX_IpBans_CreatedById", table: "IpBans", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_IpBans_IpAddress", table: "IpBans", column: "IpAddress"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "IpBans"); } } }