using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SystemRevivalServer.Migrations { /// public partial class CDNIntegration : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "AttackFrames", table: "dungeon_mob_definitions"); migrationBuilder.DropColumn( name: "DeathFrames", table: "dungeon_mob_definitions"); migrationBuilder.DropColumn( name: "IdleFrames", table: "dungeon_mob_definitions"); migrationBuilder.DropColumn( name: "SpriteIndex", table: "dungeon_mob_definitions"); migrationBuilder.DropColumn( name: "WalkFrames", table: "dungeon_mob_definitions"); migrationBuilder.AddColumn( name: "Scale", table: "dungeon_mob_definitions", type: "float", nullable: false, defaultValue: 0f); migrationBuilder.AddColumn( name: "ScenePath", table: "dungeon_mob_definitions", type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "SpritePath", table: "dungeon_item_definitions", type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "TintColor", table: "dungeon_item_definitions", type: "varchar(16)", maxLength: 16, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "client_assets", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), FilePath = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), AssetType = table.Column(type: "int", nullable: false), FileHash = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), FileSize = table.Column(type: "bigint", nullable: false), Version = table.Column(type: "int", nullable: false), IsRequired = table.Column(type: "tinyint(1)", nullable: false), MinClientVersion = table.Column(type: "varchar(16)", maxLength: 16, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CdnPath = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), UpdatedAt = table.Column(type: "datetime(6)", nullable: false), CreatedAt = table.Column(type: "datetime(6)", nullable: false), IsEnabled = table.Column(type: "tinyint(1)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_client_assets", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "client_assets"); migrationBuilder.DropColumn( name: "Scale", table: "dungeon_mob_definitions"); migrationBuilder.DropColumn( name: "ScenePath", table: "dungeon_mob_definitions"); migrationBuilder.DropColumn( name: "SpritePath", table: "dungeon_item_definitions"); migrationBuilder.DropColumn( name: "TintColor", table: "dungeon_item_definitions"); migrationBuilder.AddColumn( name: "AttackFrames", table: "dungeon_mob_definitions", type: "varchar(256)", maxLength: 256, nullable: false, defaultValue: "") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "DeathFrames", table: "dungeon_mob_definitions", type: "varchar(256)", maxLength: 256, nullable: false, defaultValue: "") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "IdleFrames", table: "dungeon_mob_definitions", type: "varchar(256)", maxLength: 256, nullable: false, defaultValue: "") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "SpriteIndex", table: "dungeon_mob_definitions", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "WalkFrames", table: "dungeon_mob_definitions", type: "varchar(256)", maxLength: 256, nullable: false, defaultValue: "") .Annotation("MySql:CharSet", "utf8mb4"); } } }