using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.Migrations.MySql { public partial class AddEFPenaltyIdentifier : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "EFPenaltyIdentifiers", columns: table => new { PenaltyIdentifierId = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), IPv4Address = table.Column(type: "int", nullable: true), NetworkId = table.Column(type: "bigint", nullable: false), PenaltyId = table.Column(type: "int", nullable: false), Active = table.Column(type: "tinyint(1)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_EFPenaltyIdentifiers", x => x.PenaltyIdentifierId); table.ForeignKey( name: "FK_EFPenaltyIdentifiers_EFPenalties_PenaltyId", column: x => x.PenaltyId, principalTable: "EFPenalties", principalColumn: "PenaltyId", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_EFPenaltyIdentifiers_IPv4Address", table: "EFPenaltyIdentifiers", column: "IPv4Address"); migrationBuilder.CreateIndex( name: "IX_EFPenaltyIdentifiers_NetworkId", table: "EFPenaltyIdentifiers", column: "NetworkId"); migrationBuilder.CreateIndex( name: "IX_EFPenaltyIdentifiers_PenaltyId", table: "EFPenaltyIdentifiers", column: "PenaltyId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "EFPenaltyIdentifiers"); migrationBuilder.AlterColumn( name: "Message", table: "InboxMessages", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Name", table: "EFWeaponAttachments", type: "longtext CHARACTER SET utf8mb4", nullable: false, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "HostName", table: "EFServers", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "EndPoint", table: "EFServers", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Offense", table: "EFPenalties", type: "longtext CHARACTER SET utf8mb4", nullable: false, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "AutomatedOffense", table: "EFPenalties", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Value", table: "EFMeta", type: "longtext CHARACTER SET utf8mb4", nullable: false, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Extra", table: "EFMeta", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Name", table: "EFMeansOfDeath", type: "longtext CHARACTER SET utf8mb4", nullable: false, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Name", table: "EFMaps", type: "longtext CHARACTER SET utf8mb4", nullable: false, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "PasswordSalt", table: "EFClients", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Password", table: "EFClients", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Message", table: "EFClientMessages", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "WeaponReference", table: "EFClientKills", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "PreviousValue", table: "EFChangeHistory", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "CurrentValue", table: "EFChangeHistory", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "WeaponReference", table: "EFACSnapshot", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "HitLocationReference", table: "EFACSnapshot", type: "longtext CHARACTER SET utf8mb4", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); } } }