using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SystemRevivalServer.Migrations { /// public partial class AddVoidScavengersEntities : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "game_items", columns: table => new { Id = table.Column(type: "int", nullable: false), Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Category = table.Column(type: "int", nullable: false), CraftCost = table.Column(type: "int", nullable: false), Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), LootValue = table.Column(type: "int", nullable: false), Stackable = table.Column(type: "tinyint(1)", nullable: false), IsEnabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: true), Damage = table.Column(type: "int", nullable: false), FireRate = table.Column(type: "float", nullable: false), ProjectileSpeed = table.Column(type: "float", nullable: false), Range = table.Column(type: "float", nullable: false), AmmoType = table.Column(type: "int", nullable: false), PelletCount = table.Column(type: "int", nullable: false), Spread = table.Column(type: "float", nullable: false), ExplosionRadius = table.Column(type: "float", nullable: false), HarvestMultiplier = table.Column(type: "float", nullable: false), ScanRadius = table.Column(type: "float", nullable: false), ScanCooldown = table.Column(type: "float", nullable: false), ShieldHealth = table.Column(type: "int", nullable: false), ShieldDuration = table.Column(type: "float", nullable: false), HealAmount = table.Column(type: "int", nullable: false), ShieldBoostDuration = table.Column(type: "float", nullable: false), DamageReduction = table.Column(type: "float", nullable: false), SpeedBoostDuration = table.Column(type: "float", nullable: false), SpeedMultiplier = table.Column(type: "float", nullable: false), HealthBonus = table.Column(type: "int", nullable: false), SpeedPenalty = table.Column(type: "float", nullable: false), DashDistance = table.Column(type: "float", nullable: false), DashCooldown = table.Column(type: "float", nullable: false), CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) }, constraints: table => { table.PrimaryKey("PK_game_items", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "game_recipes", columns: table => new { Id = table.Column(type: "int", nullable: false), ResultItemId = table.Column(type: "int", nullable: false), IsEnabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: true), ScrapCost = table.Column(type: "int", nullable: false), EnergyCost = table.Column(type: "int", nullable: false), RareCost = table.Column(type: "int", nullable: false), CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) }, constraints: table => { table.PrimaryKey("PK_game_recipes", x => x.Id); table.ForeignKey( name: "FK_game_recipes_game_items_ResultItemId", column: x => x.ResultItemId, principalTable: "game_items", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_game_items_Category", table: "game_items", column: "Category"); migrationBuilder.CreateIndex( name: "IX_game_items_IsEnabled", table: "game_items", column: "IsEnabled"); migrationBuilder.CreateIndex( name: "IX_game_recipes_IsEnabled", table: "game_recipes", column: "IsEnabled"); migrationBuilder.CreateIndex( name: "IX_game_recipes_ResultItemId", table: "game_recipes", column: "ResultItemId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "game_recipes"); migrationBuilder.DropTable( name: "game_items"); } } }