using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SystemRevivalServer.Migrations
{
///
public partial class DungeonBuilder : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "builder_room_templates",
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(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column(type: "int", nullable: false),
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),
TileGridJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TilePlacementsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ObjectPlacementsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConnectionPointsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MobSpawnsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ItemSpawnsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PlayerSpawnX = table.Column(type: "int", nullable: true),
PlayerSpawnY = table.Column(type: "int", nullable: true),
ExitPortalX = table.Column(type: "int", nullable: true),
ExitPortalY = table.Column(type: "int", nullable: true),
Weight = table.Column(type: "int", nullable: false),
MinTier = table.Column(type: "int", nullable: false),
MaxTier = table.Column(type: "int", nullable: false),
MinConnections = table.Column(type: "int", nullable: false),
MaxConnections = table.Column(type: "int", nullable: false),
AllowRotation = table.Column(type: "tinyint(1)", nullable: false),
AllowMirror = table.Column(type: "tinyint(1)", 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_builder_room_templates", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "dungeon_palettes",
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(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Biome = table.Column(type: "varchar(32)", maxLength: 32, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Tags = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
FloorTemplateIdsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
WallTemplateIdsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DoorTemplateIdsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DecorationIdsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ContainerIdsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TrapIdsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RoomTemplateIdsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MinRooms = table.Column(type: "int", nullable: false),
MaxRooms = table.Column(type: "int", nullable: false),
MinRoomWidth = table.Column(type: "int", nullable: false),
MaxRoomWidth = table.Column(type: "int", nullable: false),
MinRoomHeight = table.Column(type: "int", nullable: false),
MaxRoomHeight = table.Column(type: "int", nullable: false),
MinCorridorWidth = table.Column(type: "int", nullable: false),
MaxCorridorWidth = table.Column(type: "int", nullable: false),
DecorationDensity = table.Column(type: "int", nullable: false),
TrapDensity = table.Column(type: "int", nullable: false),
ContainerDensity = 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_dungeon_palettes", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "object_templates",
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(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column(type: "int", nullable: false),
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"),
SpriteSheetId = table.Column(type: "int", nullable: true),
FrameIndex = table.Column(type: "int", nullable: false),
SpritePath = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Width = table.Column(type: "int", nullable: false),
Height = table.Column(type: "int", nullable: false),
OffsetX = table.Column(type: "int", nullable: false),
OffsetY = table.Column(type: "int", nullable: false),
ZIndex = table.Column(type: "int", nullable: false),
BlocksMovement = table.Column(type: "tinyint(1)", nullable: false),
BlocksProjectiles = table.Column(type: "tinyint(1)", nullable: false),
BlocksLineOfSight = table.Column(type: "tinyint(1)", nullable: false),
BlockedCellsJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsAnimated = table.Column(type: "tinyint(1)", nullable: false),
AnimationFrameCount = table.Column(type: "int", nullable: false),
AnimationFps = table.Column(type: "float", nullable: false),
AnimationLoops = table.Column(type: "tinyint(1)", nullable: false),
AnimationStatesJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DefaultState = table.Column(type: "varchar(32)", maxLength: 32, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsInteractable = table.Column(type: "tinyint(1)", nullable: false),
TriggeredByWalk = table.Column(type: "tinyint(1)", nullable: false),
InteractionType = table.Column(type: "int", nullable: false),
InteractionState = table.Column(type: "varchar(32)", maxLength: 32, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
InteractionCooldown = table.Column(type: "float", nullable: false),
RequiredItemId = table.Column(type: "int", nullable: true),
LootTableId = table.Column(type: "int", nullable: true),
GoldAmount = table.Column(type: "int", nullable: false),
XpReward = table.Column(type: "int", nullable: false),
IsDestructible = table.Column(type: "tinyint(1)", nullable: false),
Health = table.Column(type: "int", nullable: false),
DestroyedState = table.Column(type: "varchar(32)", maxLength: 32, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DestroyedLootTableId = table.Column(type: "int", nullable: true),
Damage = table.Column(type: "int", nullable: false),
DamageTypeKey = table.Column(type: "varchar(32)", maxLength: 32, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TriggerDelay = table.Column(type: "float", nullable: false),
ResetTime = table.Column(type: "float", nullable: false),
Weight = table.Column(type: "int", nullable: false),
MinTier = table.Column(type: "int", nullable: false),
MaxTier = table.Column(type: "int", nullable: false),
MaxPerRoom = table.Column(type: "int", nullable: false),
Placement = 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_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(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(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Category = table.Column(type: "int", nullable: false),
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),
TilesJson = table.Column(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PrimaryTileDefinitionId = table.Column(type: "int", nullable: true),
IsWalkable = table.Column(type: "tinyint(1)", nullable: false),
BlocksProjectiles = table.Column(type: "tinyint(1)", nullable: false),
BlocksLineOfSight = table.Column(type: "tinyint(1)", nullable: false),
BlocksMovement = table.Column(type: "tinyint(1)", nullable: false),
SocketN = table.Column(type: "int", nullable: false),
SocketE = table.Column(type: "int", nullable: false),
SocketS = table.Column(type: "int", nullable: false),
SocketW = table.Column(type: "int", nullable: false),
SocketCustom = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Weight = table.Column(type: "int", nullable: false),
MinTier = table.Column(type: "int", nullable: false),
MaxTier = 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_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");
}
///
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");
}
}
}