Files
systemrevivalserver/Migrations/20251204143006_AddVoidScavengersEntities.cs
T
2025-12-04 09:30:32 -05:00

119 lines
6.3 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SystemRevivalServer.Migrations
{
/// <inheritdoc />
public partial class AddVoidScavengersEntities : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "game_items",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false),
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Category = table.Column<int>(type: "int", nullable: false),
CraftCost = table.Column<int>(type: "int", nullable: false),
Description = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
LootValue = table.Column<int>(type: "int", nullable: false),
Stackable = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: true),
Damage = table.Column<int>(type: "int", nullable: false),
FireRate = table.Column<float>(type: "float", nullable: false),
ProjectileSpeed = table.Column<float>(type: "float", nullable: false),
Range = table.Column<float>(type: "float", nullable: false),
AmmoType = table.Column<int>(type: "int", nullable: false),
PelletCount = table.Column<int>(type: "int", nullable: false),
Spread = table.Column<float>(type: "float", nullable: false),
ExplosionRadius = table.Column<float>(type: "float", nullable: false),
HarvestMultiplier = table.Column<float>(type: "float", nullable: false),
ScanRadius = table.Column<float>(type: "float", nullable: false),
ScanCooldown = table.Column<float>(type: "float", nullable: false),
ShieldHealth = table.Column<int>(type: "int", nullable: false),
ShieldDuration = table.Column<float>(type: "float", nullable: false),
HealAmount = table.Column<int>(type: "int", nullable: false),
ShieldBoostDuration = table.Column<float>(type: "float", nullable: false),
DamageReduction = table.Column<float>(type: "float", nullable: false),
SpeedBoostDuration = table.Column<float>(type: "float", nullable: false),
SpeedMultiplier = table.Column<float>(type: "float", nullable: false),
HealthBonus = table.Column<int>(type: "int", nullable: false),
SpeedPenalty = table.Column<float>(type: "float", nullable: false),
DashDistance = table.Column<float>(type: "float", nullable: false),
DashCooldown = table.Column<float>(type: "float", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"),
UpdatedAt = table.Column<DateTime>(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<int>(type: "int", nullable: false),
ResultItemId = table.Column<int>(type: "int", nullable: false),
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: true),
ScrapCost = table.Column<int>(type: "int", nullable: false),
EnergyCost = table.Column<int>(type: "int", nullable: false),
RareCost = table.Column<int>(type: "int", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"),
UpdatedAt = table.Column<DateTime>(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");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "game_recipes");
migrationBuilder.DropTable(
name: "game_items");
}
}
}