using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SystemRevivalServer.Migrations { /// public partial class DungeonSimulationchanges : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "AnimationFps", table: "tile_definitions", type: "float", nullable: false, defaultValue: 0f); migrationBuilder.AddColumn( name: "AnimationFrameCount", table: "tile_definitions", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "Biome", table: "tile_definitions", type: "varchar(32)", maxLength: 32, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "IsAnimated", table: "tile_definitions", type: "tinyint(1)", nullable: false, defaultValue: false); migrationBuilder.CreateTable( name: "dungeon_objects", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Type = table.Column(type: "int", nullable: false), SpritePath = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), SpriteId = table.Column(type: "int", nullable: true), InteractedSpritePath = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), BlocksMovement = table.Column(type: "tinyint(1)", nullable: false), BlocksProjectiles = table.Column(type: "tinyint(1)", nullable: false), BlocksLineOfSight = table.Column(type: "tinyint(1)", nullable: false), IsInteractable = table.Column(type: "tinyint(1)", nullable: false), IsDestructible = table.Column(type: "tinyint(1)", nullable: false), Health = table.Column(type: "int", nullable: false), InteractionType = table.Column(type: "int", nullable: false), LootTableId = table.Column(type: "int", nullable: true), Tags = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Biome = table.Column(type: "varchar(32)", maxLength: 32, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Width = table.Column(type: "int", nullable: false), Height = table.Column(type: "int", nullable: false), ZIndex = table.Column(type: "int", nullable: false), IsAnimated = table.Column(type: "tinyint(1)", nullable: false), AnimationFrameCount = table.Column(type: "int", nullable: false), AnimationFps = table.Column(type: "float", nullable: false), IsEnabled = table.Column(type: "tinyint(1)", nullable: false), CreatedAt = table.Column(type: "datetime(6)", nullable: false), UpdatedAt = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_dungeon_objects", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "dungeon_objects"); migrationBuilder.DropColumn( name: "AnimationFps", table: "tile_definitions"); migrationBuilder.DropColumn( name: "AnimationFrameCount", table: "tile_definitions"); migrationBuilder.DropColumn( name: "Biome", table: "tile_definitions"); migrationBuilder.DropColumn( name: "IsAnimated", table: "tile_definitions"); } } }