using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SystemRevivalServer.Migrations { /// public partial class AdminToolsforSprites : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "mob_ability_animation_mappings", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), AbilityAssignmentId = table.Column(type: "int", nullable: false), AnimationKey = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), DirectionSuffix = table.Column(type: "varchar(16)", maxLength: 16, nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_mob_ability_animation_mappings", x => x.Id); table.ForeignKey( name: "FK_mob_ability_animation_mappings_dungeon_mob_ability_assignmen~", column: x => x.AbilityAssignmentId, principalTable: "dungeon_mob_ability_assignments", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "mob_sprite_sheets", 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"), CdnPath = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), SheetWidth = table.Column(type: "int", nullable: false), SheetHeight = table.Column(type: "int", nullable: false), FrameWidth = table.Column(type: "int", nullable: false), FrameHeight = table.Column(type: "int", 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_mob_sprite_sheets", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "mob_animation_definitions", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), SpriteSheetId = table.Column(type: "int", nullable: false), Key = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), FrameSequence = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Fps = table.Column(type: "float", nullable: false), Loop = table.Column(type: "tinyint(1)", nullable: false), FlipX = table.Column(type: "tinyint(1)", nullable: false), FlipY = table.Column(type: "tinyint(1)", nullable: false), IsEnabled = table.Column(type: "tinyint(1)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_mob_animation_definitions", x => x.Id); table.ForeignKey( name: "FK_mob_animation_definitions_mob_sprite_sheets_SpriteSheetId", column: x => x.SpriteSheetId, principalTable: "mob_sprite_sheets", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "mob_animation_assignments", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), MobDefinitionId = table.Column(type: "int", nullable: false), AnimationDefinitionId = table.Column(type: "int", nullable: false), OverrideKey = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Priority = table.Column(type: "int", nullable: false), IsEnabled = table.Column(type: "tinyint(1)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_mob_animation_assignments", x => x.Id); table.ForeignKey( name: "FK_mob_animation_assignments_dungeon_mob_definitions_MobDefinit~", column: x => x.MobDefinitionId, principalTable: "dungeon_mob_definitions", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_mob_animation_assignments_mob_animation_definitions_Animatio~", column: x => x.AnimationDefinitionId, principalTable: "mob_animation_definitions", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_mob_ability_animation_mappings_AbilityAssignmentId", table: "mob_ability_animation_mappings", column: "AbilityAssignmentId"); migrationBuilder.CreateIndex( name: "IX_mob_animation_assignments_AnimationDefinitionId", table: "mob_animation_assignments", column: "AnimationDefinitionId"); migrationBuilder.CreateIndex( name: "IX_mob_animation_assignments_MobDefinitionId", table: "mob_animation_assignments", column: "MobDefinitionId"); migrationBuilder.CreateIndex( name: "IX_mob_animation_definitions_SpriteSheetId", table: "mob_animation_definitions", column: "SpriteSheetId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "mob_ability_animation_mappings"); migrationBuilder.DropTable( name: "mob_animation_assignments"); migrationBuilder.DropTable( name: "mob_animation_definitions"); migrationBuilder.DropTable( name: "mob_sprite_sheets"); } } }