utf8mb4_uca1400_ai_ci (MariaDB-only) breaks bootstrap on MySQL, where CREATE DATABASE/CREATE TABLE fails outright. Switch the shared playerbot schema and bootstrapped tables to utf8mb4_general_ci, matching the rest of the playerbot_v2 migrations.
111 lines
5.2 KiB
SQL
111 lines
5.2 KiB
SQL
-- ============================================================================
|
|
-- PlayerbotV2: Shared playerbot database bootstrap
|
|
-- Creates the `playerbot` database and all tables required by the module.
|
|
-- Run this once after installing the module.
|
|
--
|
|
-- Usage: mysql -u root -p < playerbot_bootstrap.sql
|
|
-- This file is NOT part of TrinityCore's auto-updater.
|
|
-- ============================================================================
|
|
|
|
CREATE DATABASE IF NOT EXISTS `playerbot` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
|
|
|
USE `playerbot`;
|
|
|
|
-- ---------------------------------------------------------------------------
|
|
-- Handcrafted roads: operator-curated road centerlines for navmesh re-tagging
|
|
-- and bot pathfinding. Queried by HandcraftedRoadStorage.
|
|
-- ---------------------------------------------------------------------------
|
|
CREATE TABLE IF NOT EXISTS `handcrafted_road` (
|
|
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
`mapId` INT UNSIGNED NOT NULL,
|
|
`fromX` FLOAT NOT NULL,
|
|
`fromY` FLOAT NOT NULL,
|
|
`fromZ` FLOAT NOT NULL DEFAULT 0,
|
|
`toX` FLOAT NOT NULL DEFAULT 0,
|
|
`toY` FLOAT NOT NULL DEFAULT 0,
|
|
`toZ` FLOAT NOT NULL DEFAULT 0,
|
|
`width` FLOAT NOT NULL DEFAULT 2.0,
|
|
`comment` VARCHAR(255) DEFAULT NULL,
|
|
`verified` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
|
PRIMARY KEY (`id`),
|
|
KEY `idx_map` (`mapId`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
|
|
|
-- ---------------------------------------------------------------------------
|
|
-- Bot name pool: pre-generated names for spawned bots.
|
|
-- Queried by Fleet::BotNamePool.
|
|
-- ---------------------------------------------------------------------------
|
|
CREATE TABLE IF NOT EXISTS `playerbots_names` (
|
|
`name_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
`name` VARCHAR(12) NOT NULL,
|
|
`gender` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
|
`is_used` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
|
`used_by_guid` BIGINT UNSIGNED DEFAULT NULL,
|
|
PRIMARY KEY (`name_id`),
|
|
UNIQUE KEY `uk_name` (`name`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
|
|
|
-- ---------------------------------------------------------------------------
|
|
-- Dungeon route waypoints: auto-generated navmesh corridor chains.
|
|
-- Queried by DungeonScriptMgr.
|
|
-- ---------------------------------------------------------------------------
|
|
CREATE TABLE IF NOT EXISTS `playerbot_dungeon_routes` (
|
|
`map_id` SMALLINT UNSIGNED NOT NULL,
|
|
`difficulty` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '0 = any difficulty',
|
|
`seq` SMALLINT UNSIGNED NOT NULL COMMENT 'ordered chain index',
|
|
`position_x` FLOAT NOT NULL,
|
|
`position_y` FLOAT NOT NULL,
|
|
`position_z` FLOAT NOT NULL,
|
|
PRIMARY KEY (`map_id`, `difficulty`, `seq`),
|
|
KEY `map_idx` (`map_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
|
|
|
-- ---------------------------------------------------------------------------
|
|
-- Nav links: DB-authored traversal links (jumps, unmeshed walkable stretches).
|
|
-- Queried by the dungeon stepper and travel graph.
|
|
-- ---------------------------------------------------------------------------
|
|
CREATE TABLE IF NOT EXISTS `playerbot_nav_links` (
|
|
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
`map_id` SMALLINT UNSIGNED NOT NULL,
|
|
`from_x` FLOAT NOT NULL,
|
|
`from_y` FLOAT NOT NULL,
|
|
`from_z` FLOAT NOT NULL,
|
|
`to_x` FLOAT NOT NULL,
|
|
`to_y` FLOAT NOT NULL,
|
|
`to_z` FLOAT NOT NULL,
|
|
`radius` FLOAT NOT NULL DEFAULT 12 COMMENT 'mouth proximity (3D yards)',
|
|
`verified` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
|
`created_by` VARCHAR(64) NOT NULL DEFAULT '',
|
|
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
`comment` VARCHAR(255) NOT NULL DEFAULT '',
|
|
PRIMARY KEY (`id`),
|
|
KEY `idx_map` (`map_id`),
|
|
KEY `idx_verified` (`verified`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
|
|
|
-- ---------------------------------------------------------------------------
|
|
-- World metadata: operator-curated world knowledge (cities, roads, danger
|
|
-- zones, vendors, mailboxes, innkeepers, crossroads). Populated via
|
|
-- `.playerbot meta add` GM commands.
|
|
-- ---------------------------------------------------------------------------
|
|
CREATE TABLE IF NOT EXISTS `playerbot_v2_world_metadata` (
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
`map_id` INT UNSIGNED NOT NULL,
|
|
`zone_id` INT UNSIGNED NOT NULL DEFAULT 0,
|
|
`kind` TINYINT UNSIGNED NOT NULL,
|
|
`pos_x` FLOAT NOT NULL,
|
|
`pos_y` FLOAT NOT NULL,
|
|
`pos_z` FLOAT NOT NULL,
|
|
`radius` FLOAT NOT NULL DEFAULT 10.0,
|
|
`label` VARCHAR(96) NOT NULL DEFAULT '',
|
|
`notes` VARCHAR(255) NOT NULL DEFAULT '',
|
|
`created_by` VARCHAR(64) NOT NULL DEFAULT '',
|
|
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
ON UPDATE CURRENT_TIMESTAMP,
|
|
KEY `idx_map_kind` (map_id, kind),
|
|
KEY `idx_map_xy` (map_id, pos_x, pos_y),
|
|
KEY `idx_zone` (zone_id),
|
|
KEY `idx_kind` (kind)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|