267 lines
17 KiB
C#
267 lines
17 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace SystemRevivalServer.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class DungeonBuilder : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "builder_room_templates",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Description = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Type = table.Column<int>(type: "int", nullable: false),
|
|
Tags = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Biome = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Width = table.Column<int>(type: "int", nullable: false),
|
|
Height = table.Column<int>(type: "int", nullable: false),
|
|
TileGridJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
TilePlacementsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ObjectPlacementsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ConnectionPointsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
MobSpawnsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ItemSpawnsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
PlayerSpawnX = table.Column<int>(type: "int", nullable: true),
|
|
PlayerSpawnY = table.Column<int>(type: "int", nullable: true),
|
|
ExitPortalX = table.Column<int>(type: "int", nullable: true),
|
|
ExitPortalY = table.Column<int>(type: "int", nullable: true),
|
|
Weight = table.Column<int>(type: "int", nullable: false),
|
|
MinTier = table.Column<int>(type: "int", nullable: false),
|
|
MaxTier = table.Column<int>(type: "int", nullable: false),
|
|
MinConnections = table.Column<int>(type: "int", nullable: false),
|
|
MaxConnections = table.Column<int>(type: "int", nullable: false),
|
|
AllowRotation = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
AllowMirror = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_builder_room_templates", x => x.Id);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "dungeon_palettes",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Description = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Biome = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Tags = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
FloorTemplateIdsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
WallTemplateIdsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
DoorTemplateIdsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
DecorationIdsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ContainerIdsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
TrapIdsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
RoomTemplateIdsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
MinRooms = table.Column<int>(type: "int", nullable: false),
|
|
MaxRooms = table.Column<int>(type: "int", nullable: false),
|
|
MinRoomWidth = table.Column<int>(type: "int", nullable: false),
|
|
MaxRoomWidth = table.Column<int>(type: "int", nullable: false),
|
|
MinRoomHeight = table.Column<int>(type: "int", nullable: false),
|
|
MaxRoomHeight = table.Column<int>(type: "int", nullable: false),
|
|
MinCorridorWidth = table.Column<int>(type: "int", nullable: false),
|
|
MaxCorridorWidth = table.Column<int>(type: "int", nullable: false),
|
|
DecorationDensity = table.Column<int>(type: "int", nullable: false),
|
|
TrapDensity = table.Column<int>(type: "int", nullable: false),
|
|
ContainerDensity = table.Column<int>(type: "int", nullable: false),
|
|
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_dungeon_palettes", x => x.Id);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "object_templates",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Description = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Type = table.Column<int>(type: "int", nullable: false),
|
|
Tags = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Biome = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
SpriteSheetId = table.Column<int>(type: "int", nullable: true),
|
|
FrameIndex = table.Column<int>(type: "int", nullable: false),
|
|
SpritePath = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Width = table.Column<int>(type: "int", nullable: false),
|
|
Height = table.Column<int>(type: "int", nullable: false),
|
|
OffsetX = table.Column<int>(type: "int", nullable: false),
|
|
OffsetY = table.Column<int>(type: "int", nullable: false),
|
|
ZIndex = table.Column<int>(type: "int", nullable: false),
|
|
BlocksMovement = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
BlocksProjectiles = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
BlocksLineOfSight = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
BlockedCellsJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
IsAnimated = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
AnimationFrameCount = table.Column<int>(type: "int", nullable: false),
|
|
AnimationFps = table.Column<float>(type: "float", nullable: false),
|
|
AnimationLoops = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
AnimationStatesJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
DefaultState = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
IsInteractable = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
TriggeredByWalk = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
InteractionType = table.Column<int>(type: "int", nullable: false),
|
|
InteractionState = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
InteractionCooldown = table.Column<float>(type: "float", nullable: false),
|
|
RequiredItemId = table.Column<int>(type: "int", nullable: true),
|
|
LootTableId = table.Column<int>(type: "int", nullable: true),
|
|
GoldAmount = table.Column<int>(type: "int", nullable: false),
|
|
XpReward = table.Column<int>(type: "int", nullable: false),
|
|
IsDestructible = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
Health = table.Column<int>(type: "int", nullable: false),
|
|
DestroyedState = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
DestroyedLootTableId = table.Column<int>(type: "int", nullable: true),
|
|
Damage = table.Column<int>(type: "int", nullable: false),
|
|
DamageTypeKey = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
TriggerDelay = table.Column<float>(type: "float", nullable: false),
|
|
ResetTime = table.Column<float>(type: "float", nullable: false),
|
|
Weight = table.Column<int>(type: "int", nullable: false),
|
|
MinTier = table.Column<int>(type: "int", nullable: false),
|
|
MaxTier = table.Column<int>(type: "int", nullable: false),
|
|
MaxPerRoom = table.Column<int>(type: "int", nullable: false),
|
|
Placement = table.Column<int>(type: "int", nullable: false),
|
|
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_object_templates", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_object_templates_tilemap_sheets_SpriteSheetId",
|
|
column: x => x.SpriteSheetId,
|
|
principalTable: "tilemap_sheets",
|
|
principalColumn: "Id");
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "tile_templates",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Description = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Category = table.Column<int>(type: "int", nullable: false),
|
|
Tags = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Biome = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Width = table.Column<int>(type: "int", nullable: false),
|
|
Height = table.Column<int>(type: "int", nullable: false),
|
|
TilesJson = table.Column<string>(type: "json", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
PrimaryTileDefinitionId = table.Column<int>(type: "int", nullable: true),
|
|
IsWalkable = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
BlocksProjectiles = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
BlocksLineOfSight = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
BlocksMovement = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
SocketN = table.Column<int>(type: "int", nullable: false),
|
|
SocketE = table.Column<int>(type: "int", nullable: false),
|
|
SocketS = table.Column<int>(type: "int", nullable: false),
|
|
SocketW = table.Column<int>(type: "int", nullable: false),
|
|
SocketCustom = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Weight = table.Column<int>(type: "int", nullable: false),
|
|
MinTier = table.Column<int>(type: "int", nullable: false),
|
|
MaxTier = table.Column<int>(type: "int", nullable: false),
|
|
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_tile_templates", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_tile_templates_tile_definitions_PrimaryTileDefinitionId",
|
|
column: x => x.PrimaryTileDefinitionId,
|
|
principalTable: "tile_definitions",
|
|
principalColumn: "Id");
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_object_templates_SpriteSheetId",
|
|
table: "object_templates",
|
|
column: "SpriteSheetId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_tile_templates_PrimaryTileDefinitionId",
|
|
table: "tile_templates",
|
|
column: "PrimaryTileDefinitionId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "builder_room_templates");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "dungeon_palettes");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "object_templates");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "tile_templates");
|
|
}
|
|
}
|
|
}
|