init rework
This commit is contained in:
@@ -0,0 +1,233 @@
|
||||
-- Housing: player houses, rooms, decor, catalog, blueprints and neighborhoods
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `account_housing_blueprint` (
|
||||
`id` bigint unsigned NOT NULL,
|
||||
`uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`bnetAccountId` int unsigned NOT NULL,
|
||||
`exporterGuid` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'Character that exported it',
|
||||
`name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||||
`type` tinyint unsigned NOT NULL COMMENT 'HousingBlueprintType: 1 House, 2 Room, 3 Interior, 4 Exterior',
|
||||
`flags` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'HousingBlueprintFlag: 1 AutomaticBackup',
|
||||
`createTime` bigint NOT NULL DEFAULT '0',
|
||||
`content` mediumblob NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_uuid` (`uuid`),
|
||||
KEY `idx_bnetAccountId` (`bnetAccountId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `account_housing_room` (
|
||||
`bnetAccountId` int unsigned NOT NULL,
|
||||
`roomId` int unsigned NOT NULL COMMENT 'HouseRoom.db2 ID unlocked for the account (level award rooms)',
|
||||
PRIMARY KEY (`bnetAccountId`,`roomId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `account_housing_house_type` (
|
||||
`bnetAccountId` int unsigned NOT NULL,
|
||||
`houseExteriorWmoDataId` int unsigned NOT NULL COMMENT 'HouseExteriorWmoData.db2 ID unlocked for the account (item facades)',
|
||||
PRIMARY KEY (`bnetAccountId`,`houseExteriorWmoDataId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
DROP TABLE IF EXISTS `character_housing`;
|
||||
CREATE TABLE `character_housing` (
|
||||
`guid` bigint UNSIGNED NOT NULL COMMENT 'Player GUID',
|
||||
`houseId` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'House DB2 entry ID',
|
||||
`neighborhoodGuid` bigint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'FK to neighborhoods.guid',
|
||||
`plotIndex` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Plot within neighborhood (0..MAX_NEIGHBORHOOD_PLOTS-1)',
|
||||
`houseLevel` int UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Current upgrade level',
|
||||
`favor` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Accumulated favor currency',
|
||||
`settingsFlags` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Bitmask of HouseSettingsFlags',
|
||||
`exteriorLocked` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Whether exterior editing is locked (1=locked, 0=unlocked)',
|
||||
`houseSize` tinyint UNSIGNED NOT NULL DEFAULT 2 COMMENT 'HousingFixtureSize: 1=Any, 2=Small, 3=Medium, 4=Large',
|
||||
`houseType` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'HouseExteriorWmoData DB2 entry ID (architectural style)',
|
||||
`createTime` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Unix timestamp of house creation',
|
||||
`posX` float NOT NULL DEFAULT 0 COMMENT 'House X position on plot',
|
||||
`posY` float NOT NULL DEFAULT 0 COMMENT 'House Y position on plot',
|
||||
`posZ` float NOT NULL DEFAULT 0 COMMENT 'House Z position on plot',
|
||||
`facing` float NOT NULL DEFAULT 0 COMMENT 'House facing angle on plot',
|
||||
`houseName` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'Player-set house display name',
|
||||
`houseDescription` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'Player-set house description',
|
||||
PRIMARY KEY (`guid`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
DROP TABLE IF EXISTS `character_housing_catalog`;
|
||||
CREATE TABLE `character_housing_catalog` (
|
||||
`ownerGuid` int NOT NULL DEFAULT 0,
|
||||
`houseDecorId` int UNSIGNED NOT NULL COMMENT 'HouseDecor DB2 entry ID',
|
||||
`quantity` decimal(54, 0) NULL DEFAULT NULL,
|
||||
`sourceType` tinyint UNSIGNED NULL DEFAULT NULL COMMENT 'DecorSourceType: 0=Standard, 3=Deferred, 5=Spell, 6=Item',
|
||||
`sourceValue` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'Source context (spell ID, item GUID, etc.)',
|
||||
PRIMARY KEY (`ownerGuid`, `houseDecorId`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
DROP TABLE IF EXISTS `character_housing_decor`;
|
||||
CREATE TABLE `character_housing_decor` (
|
||||
`ownerGuid` bigint UNSIGNED NOT NULL COMMENT 'FK to character_housing.guid',
|
||||
`id` bigint UNSIGNED NOT NULL COMMENT 'Decor instance ID (unique per owner)',
|
||||
`houseDecorId` int UNSIGNED NOT NULL COMMENT 'HouseDecor DB2 entry ID',
|
||||
`posX` float NOT NULL DEFAULT 0 COMMENT 'X position in room/house coordinates',
|
||||
`posY` float NOT NULL DEFAULT 0 COMMENT 'Y position in room/house coordinates',
|
||||
`posZ` float NOT NULL DEFAULT 0 COMMENT 'Z position in room/house coordinates',
|
||||
`rotX` float NOT NULL DEFAULT 0 COMMENT 'Quaternion rotation X component',
|
||||
`rotY` float NOT NULL DEFAULT 0 COMMENT 'Quaternion rotation Y component',
|
||||
`rotZ` float NOT NULL DEFAULT 0 COMMENT 'Quaternion rotation Z component',
|
||||
`rotW` float NOT NULL DEFAULT 1 COMMENT 'Quaternion rotation W component',
|
||||
`scale` float NOT NULL DEFAULT 1,
|
||||
`dyeSlot0` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Dye color ID for slot 0',
|
||||
`dyeSlot1` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Dye color ID for slot 1',
|
||||
`dyeSlot2` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Dye color ID for slot 2',
|
||||
`roomGuid` bigint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'FK to character_housing_rooms.id (0 = outdoor/unassigned)',
|
||||
`locked` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Whether the decor item is locked in place (1=locked, 0=unlocked)',
|
||||
`placementTime` bigint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Unix timestamp when decor was placed (for refund window)',
|
||||
`sourceType` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'DecorSourceType: 0=Standard, 3=Deferred, 5=Spell, 6=Item',
|
||||
`sourceValue` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'Source context (spell ID, item GUID, etc.)',
|
||||
`petGuid` bigint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Battle pet counter bound to this decor slot (0 = none), HighGuid::BattlePet',
|
||||
`petFlag` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Client-sent flag accompanying the pet binding (CMSG_HOUSING_DECOR_SET_PET)',
|
||||
`parentDecorGuid` bigint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Counter of the decor this item is stacked on (0 = none)',
|
||||
PRIMARY KEY (`ownerGuid`, `id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
DROP TABLE IF EXISTS `character_housing_fixtures`;
|
||||
CREATE TABLE `character_housing_fixtures` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Unique fixture assignment ID',
|
||||
`ownerGuid` bigint UNSIGNED NOT NULL COMMENT 'FK to character_housing.guid',
|
||||
`fixturePointId` int UNSIGNED NOT NULL COMMENT 'Predefined fixture point identifier',
|
||||
`fixtureOptionId` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Selected fixture option (0 = default)',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_owner`(`ownerGuid` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 5474 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
DROP TABLE IF EXISTS `character_housing_ignored_neighborhood`;
|
||||
CREATE TABLE `character_housing_ignored_neighborhood` (
|
||||
`ownerGuid` bigint UNSIGNED NOT NULL COMMENT 'Player character GUID counter',
|
||||
`neighborhoodGuid` bigint UNSIGNED NOT NULL COMMENT 'Ignored neighborhood GUID counter',
|
||||
PRIMARY KEY (`ownerGuid`, `neighborhoodGuid`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
DROP TABLE IF EXISTS `character_housing_rooms`;
|
||||
CREATE TABLE `character_housing_rooms` (
|
||||
`ownerGuid` bigint UNSIGNED NOT NULL COMMENT 'FK to character_housing.guid',
|
||||
`id` bigint UNSIGNED NOT NULL COMMENT 'Room instance ID (unique per owner)',
|
||||
`houseRoomId` int UNSIGNED NOT NULL COMMENT 'HouseRoom DB2 entry ID',
|
||||
`slotIndex` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Room slot within the house layout',
|
||||
`gridX` int NOT NULL DEFAULT 0,
|
||||
`gridY` int NOT NULL DEFAULT 0,
|
||||
`floorIndex` int NOT NULL DEFAULT 0,
|
||||
`orientation` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Room rotation orientation value',
|
||||
`mirrored` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Boolean: 1 = room layout is mirrored',
|
||||
`themeId` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Visual theme applied to the room',
|
||||
`wallTextureId` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'RoomComponentTexture ID for walls',
|
||||
`floorTextureId` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'RoomComponentTexture ID for floors',
|
||||
`ceilingTextureId` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'RoomComponentTexture ID for ceilings',
|
||||
`colorOverride` int NOT NULL DEFAULT -1 COMMENT 'Color override for materials (-1 = default)',
|
||||
`doorTypeId` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Door type for the room',
|
||||
`doorSlot` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Door slot index within the room',
|
||||
`ceilingTypeId` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Ceiling type for the room',
|
||||
`ceilingSlot` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Ceiling slot index within the room',
|
||||
`wallThemeId` int UNSIGNED NOT NULL DEFAULT 0,
|
||||
`floorThemeId` int UNSIGNED NOT NULL DEFAULT 0,
|
||||
`ceilingThemeId` int UNSIGNED NOT NULL DEFAULT 0,
|
||||
`doorTypes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||||
`componentStyles` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`ownerGuid`, `id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_charter_signatures` (
|
||||
`charterId` bigint unsigned NOT NULL COMMENT 'FK to neighborhood_charters.id',
|
||||
`signerGuid` bigint unsigned NOT NULL COMMENT 'Player GUID of the signer',
|
||||
`signTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when the signature was made',
|
||||
PRIMARY KEY (`charterId`,`signerGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_charters` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique charter ID',
|
||||
`creatorGuid` bigint unsigned NOT NULL COMMENT 'Player GUID of the charter creator',
|
||||
`name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Proposed neighborhood name (max HOUSING_MAX_NAME_LENGTH)',
|
||||
`neighborhoodMapId` int unsigned NOT NULL COMMENT 'NeighborhoodMap DB2 entry ID for the target map',
|
||||
`factionFlags` int unsigned NOT NULL DEFAULT '0' COMMENT 'Faction restriction flags for the neighborhood',
|
||||
`isGuild` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Boolean: 1 = guild-associated neighborhood',
|
||||
`createTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp of charter creation',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_creator` (`creatorGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_initiative_contributions` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
`initiativeDbId` bigint unsigned NOT NULL COMMENT 'FK to neighborhood_initiatives.id',
|
||||
`playerGuid` bigint unsigned NOT NULL COMMENT 'Player character GUID',
|
||||
`taskId` int unsigned NOT NULL COMMENT 'InitiativeTask DB2 entry ID',
|
||||
`amount` int unsigned NOT NULL DEFAULT '0' COMMENT 'Cumulative contribution to this task',
|
||||
`lastUpdated` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp of last contribution',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_initiative_player_task` (`initiativeDbId`,`playerGuid`,`taskId`),
|
||||
KEY `idx_player` (`playerGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_initiative_milestones` (
|
||||
`initiativeDbId` bigint unsigned NOT NULL COMMENT 'FK to neighborhood_initiatives.id',
|
||||
`milestoneIndex` int unsigned NOT NULL COMMENT 'Milestone index (0, 1, 2)',
|
||||
`reached` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '1 = milestone has been reached',
|
||||
`reachedTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when milestone was reached',
|
||||
PRIMARY KEY (`initiativeDbId`,`milestoneIndex`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_initiative_reward_claims` (
|
||||
`initiativeDbId` bigint unsigned NOT NULL COMMENT 'FK to neighborhood_initiatives.id',
|
||||
`milestoneIndex` int unsigned NOT NULL COMMENT 'Milestone index (0, 1, 2)',
|
||||
`playerGuid` bigint unsigned NOT NULL COMMENT 'Player character GUID',
|
||||
`claimTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when reward was claimed',
|
||||
PRIMARY KEY (`initiativeDbId`,`milestoneIndex`,`playerGuid`),
|
||||
KEY `idx_player` (`playerGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_initiative_task_progress` (
|
||||
`initiativeDbId` bigint unsigned NOT NULL COMMENT 'FK to neighborhood_initiatives.id',
|
||||
`taskId` int unsigned NOT NULL COMMENT 'InitiativeTask DB2 entry ID',
|
||||
`progress` int unsigned NOT NULL DEFAULT '0' COMMENT 'Current progress count towards TargetCount',
|
||||
`status` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '0=NOT_STARTED, 1=IN_PROGRESS, 2=COMPLETE',
|
||||
PRIMARY KEY (`initiativeDbId`,`taskId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_initiatives` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique initiative instance ID',
|
||||
`neighborhoodGuid` bigint unsigned NOT NULL COMMENT 'FK to neighborhoods.guid',
|
||||
`initiativeId` int unsigned NOT NULL COMMENT 'NeighborhoodInitiative DB2 entry ID',
|
||||
`startTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when the initiative began',
|
||||
`progress` float NOT NULL DEFAULT '0' COMMENT 'Completion progress (0.0 to 1.0)',
|
||||
`completed` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Boolean: 1 = initiative completed',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_neighborhood` (`neighborhoodGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_invites` (
|
||||
`neighborhoodGuid` bigint unsigned NOT NULL COMMENT 'FK to neighborhoods.guid',
|
||||
`inviteeGuid` bigint unsigned NOT NULL COMMENT 'Player GUID of the invited player',
|
||||
`inviterGuid` bigint unsigned NOT NULL COMMENT 'Player GUID of the player who sent the invite',
|
||||
`inviteTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when the invite was sent',
|
||||
PRIMARY KEY (`neighborhoodGuid`,`inviteeGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_members` (
|
||||
`neighborhoodGuid` bigint unsigned NOT NULL COMMENT 'FK to neighborhoods.guid',
|
||||
`playerGuid` bigint unsigned NOT NULL COMMENT 'Player GUID of the member',
|
||||
`role` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'NeighborhoodMemberRole: 0=Resident, 1=Manager, 2=Owner',
|
||||
`joinTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when the player joined',
|
||||
`plotIndex` tinyint unsigned NOT NULL DEFAULT '255' COMMENT 'Assigned plot index (255 = INVALID_PLOT_INDEX, no plot)',
|
||||
PRIMARY KEY (`neighborhoodGuid`,`playerGuid`),
|
||||
KEY `idx_player` (`playerGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
DROP TABLE IF EXISTS `neighborhoods`;
|
||||
CREATE TABLE `neighborhoods` (
|
||||
`guid` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Unique neighborhood instance ID',
|
||||
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Neighborhood display name (max HOUSING_MAX_NAME_LENGTH)',
|
||||
`neighborhoodMapId` int UNSIGNED NOT NULL COMMENT 'NeighborhoodMap DB2 entry ID',
|
||||
`ownerGuid` bigint UNSIGNED NOT NULL COMMENT 'Player GUID of the neighborhood founder/owner',
|
||||
`factionRestriction` int NOT NULL DEFAULT 0 COMMENT 'NeighborhoodFactionRestriction: 0=None, 1=Horde, 2=Alliance',
|
||||
`isPublic` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Boolean: 1 = publicly listed and joinable',
|
||||
`createTime` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Unix timestamp of neighborhood creation',
|
||||
`guildId` int UNSIGNED NOT NULL DEFAULT 0 COMMENT 'M8: owning guild id for guild neighborhoods (0 = not guild-linked)',
|
||||
PRIMARY KEY (`guid`) USING BTREE,
|
||||
INDEX `idx_owner`(`ownerGuid` ASC) USING BTREE,
|
||||
INDEX `idx_map`(`neighborhoodMapId` ASC) USING BTREE,
|
||||
INDEX `idx_guild`(`guildId` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
|
||||
@@ -1,386 +0,0 @@
|
||||
-- RoleplayCore housing cutover. Stop both servers and back up all databases first.
|
||||
CREATE TABLE IF NOT EXISTS `rp_housing_migration` (
|
||||
`stage` varchar(32) NOT NULL, `completedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`stage`)
|
||||
) ENGINE=InnoDB;
|
||||
DROP PROCEDURE IF EXISTS `rp_housing_archive`;
|
||||
DELIMITER $$
|
||||
CREATE PROCEDURE `rp_housing_archive`()
|
||||
BEGIN
|
||||
IF NOT EXISTS (SELECT 1 FROM `rp_housing_migration` WHERE `stage`='characters_archived') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='character_housing' AND column_name='guid')
|
||||
AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='character_housing' AND column_name='OwnerGuid') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Unmanaged new housing schema: verify migration history';
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='character_housing') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_character_housing') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: character_housing';
|
||||
END IF;
|
||||
RENAME TABLE `character_housing` TO `rp_housing_legacy_character_housing`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_neighborhood') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_neighborhood') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_neighborhood';
|
||||
END IF;
|
||||
RENAME TABLE `housing_neighborhood` TO `rp_housing_legacy_housing_neighborhood`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_plot_template') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_plot_template') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_plot_template';
|
||||
END IF;
|
||||
RENAME TABLE `housing_plot_template` TO `rp_housing_legacy_housing_plot_template`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_plot_reservation') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_plot_reservation') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_plot_reservation';
|
||||
END IF;
|
||||
RENAME TABLE `housing_plot_reservation` TO `rp_housing_legacy_housing_plot_reservation`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_plot_transaction') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_plot_transaction') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_plot_transaction';
|
||||
END IF;
|
||||
RENAME TABLE `housing_plot_transaction` TO `rp_housing_legacy_housing_plot_transaction`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='character_housing_map_context') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_character_housing_map_context') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: character_housing_map_context';
|
||||
END IF;
|
||||
RENAME TABLE `character_housing_map_context` TO `rp_housing_legacy_character_housing_map_context`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_map_instance') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_map_instance') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_map_instance';
|
||||
END IF;
|
||||
RENAME TABLE `housing_map_instance` TO `rp_housing_legacy_housing_map_instance`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='character_housing_neighborhood_invite') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_character_housing_neighborhood_invite') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: character_housing_neighborhood_invite';
|
||||
END IF;
|
||||
RENAME TABLE `character_housing_neighborhood_invite` TO `rp_housing_legacy_character_housing_neighborhood_invite`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='character_housing_neighborhood_role') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_character_housing_neighborhood_role') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: character_housing_neighborhood_role';
|
||||
END IF;
|
||||
RENAME TABLE `character_housing_neighborhood_role` TO `rp_housing_legacy_character_housing_neighborhood_role`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='character_housing_finder_ignore') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_character_housing_finder_ignore') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: character_housing_finder_ignore';
|
||||
END IF;
|
||||
RENAME TABLE `character_housing_finder_ignore` TO `rp_housing_legacy_character_housing_finder_ignore`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='character_housing_return_location') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_character_housing_return_location') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: character_housing_return_location';
|
||||
END IF;
|
||||
RENAME TABLE `character_housing_return_location` TO `rp_housing_legacy_character_housing_return_location`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='character_housing_permission') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_character_housing_permission') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: character_housing_permission';
|
||||
END IF;
|
||||
RENAME TABLE `character_housing_permission` TO `rp_housing_legacy_character_housing_permission`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_room_entity') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_room_entity') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_room_entity';
|
||||
END IF;
|
||||
RENAME TABLE `housing_room_entity` TO `rp_housing_legacy_housing_room_entity`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_room_component_entity') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_room_component_entity') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_room_component_entity';
|
||||
END IF;
|
||||
RENAME TABLE `housing_room_component_entity` TO `rp_housing_legacy_housing_room_component_entity`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_room_connection') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_room_connection') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_room_connection';
|
||||
END IF;
|
||||
RENAME TABLE `housing_room_connection` TO `rp_housing_legacy_housing_room_connection`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_fixture_entity') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_fixture_entity') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_fixture_entity';
|
||||
END IF;
|
||||
RENAME TABLE `housing_fixture_entity` TO `rp_housing_legacy_housing_fixture_entity`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_placed_decor') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_placed_decor') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_placed_decor';
|
||||
END IF;
|
||||
RENAME TABLE `housing_placed_decor` TO `rp_housing_legacy_housing_placed_decor`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_decor_instance') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_decor_instance') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_decor_instance';
|
||||
END IF;
|
||||
RENAME TABLE `housing_decor_instance` TO `rp_housing_legacy_housing_decor_instance`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='account_housing_decor') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_account_housing_decor') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: account_housing_decor';
|
||||
END IF;
|
||||
RENAME TABLE `account_housing_decor` TO `rp_housing_legacy_account_housing_decor`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_entity_quarantine') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_entity_quarantine') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_entity_quarantine';
|
||||
END IF;
|
||||
RENAME TABLE `housing_entity_quarantine` TO `rp_housing_legacy_housing_entity_quarantine`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_blueprint') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_blueprint') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_blueprint';
|
||||
END IF;
|
||||
RENAME TABLE `housing_blueprint` TO `rp_housing_legacy_housing_blueprint`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_blueprint_item') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_blueprint_item') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_blueprint_item';
|
||||
END IF;
|
||||
RENAME TABLE `housing_blueprint_item` TO `rp_housing_legacy_housing_blueprint_item`;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='housing_deferred_decor_redemption') THEN
|
||||
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE() AND table_name='rp_housing_legacy_housing_deferred_decor_redemption') THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Housing archive collision: housing_deferred_decor_redemption';
|
||||
END IF;
|
||||
RENAME TABLE `housing_deferred_decor_redemption` TO `rp_housing_legacy_housing_deferred_decor_redemption`;
|
||||
END IF;
|
||||
INSERT INTO `rp_housing_migration` (`stage`) VALUES ('characters_archived');
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
CALL `rp_housing_archive`();
|
||||
DROP PROCEDURE `rp_housing_archive`;
|
||||
-- Housing: player houses, rooms, decor, catalog, blueprints and neighborhoods
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `account_housing_blueprint` (
|
||||
`id` bigint unsigned NOT NULL,
|
||||
`uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`bnetAccountId` int unsigned NOT NULL,
|
||||
`exporterGuid` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'Character that exported it',
|
||||
`name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||||
`type` tinyint unsigned NOT NULL COMMENT 'HousingBlueprintType: 1 House, 2 Room, 3 Interior, 4 Exterior',
|
||||
`flags` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'HousingBlueprintFlag: 1 AutomaticBackup',
|
||||
`createTime` bigint NOT NULL DEFAULT '0',
|
||||
`content` mediumblob NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_uuid` (`uuid`),
|
||||
KEY `idx_bnetAccountId` (`bnetAccountId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `account_housing_room` (
|
||||
`bnetAccountId` int unsigned NOT NULL,
|
||||
`roomId` int unsigned NOT NULL COMMENT 'HouseRoom.db2 ID unlocked for the account (level award rooms)',
|
||||
PRIMARY KEY (`bnetAccountId`,`roomId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `account_housing_house_type` (
|
||||
`bnetAccountId` int unsigned NOT NULL,
|
||||
`houseExteriorWmoDataId` int unsigned NOT NULL COMMENT 'HouseExteriorWmoData.db2 ID unlocked for the account (item facades)',
|
||||
PRIMARY KEY (`bnetAccountId`,`houseExteriorWmoDataId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `character_housing` (
|
||||
`guid` bigint unsigned NOT NULL COMMENT 'Player GUID',
|
||||
`houseId` int unsigned NOT NULL DEFAULT '0' COMMENT 'House DB2 entry ID',
|
||||
`neighborhoodGuid` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'FK to neighborhoods.guid',
|
||||
`plotIndex` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Plot within neighborhood (0..MAX_NEIGHBORHOOD_PLOTS-1)',
|
||||
`houseLevel` int unsigned NOT NULL DEFAULT '1' COMMENT 'Current upgrade level',
|
||||
`favor` int unsigned NOT NULL DEFAULT '0' COMMENT 'Accumulated favor currency',
|
||||
`settingsFlags` int unsigned NOT NULL DEFAULT '0' COMMENT 'Bitmask of HouseSettingsFlags',
|
||||
`exteriorLocked` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Whether exterior editing is locked (1=locked, 0=unlocked)',
|
||||
`houseSize` tinyint unsigned NOT NULL DEFAULT '2' COMMENT 'HousingFixtureSize: 1=Any, 2=Small, 3=Medium, 4=Large',
|
||||
`houseType` int unsigned NOT NULL DEFAULT '0' COMMENT 'HouseExteriorWmoData DB2 entry ID (architectural style)',
|
||||
`createTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp of house creation',
|
||||
`posX` float NOT NULL DEFAULT '0' COMMENT 'House X position on plot',
|
||||
`posY` float NOT NULL DEFAULT '0' COMMENT 'House Y position on plot',
|
||||
`posZ` float NOT NULL DEFAULT '0' COMMENT 'House Z position on plot',
|
||||
`facing` float NOT NULL DEFAULT '0' COMMENT 'House facing angle on plot',
|
||||
`houseName` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'Player-set house display name',
|
||||
`houseDescription` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'Player-set house description',
|
||||
PRIMARY KEY (`guid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `character_housing_catalog` (
|
||||
`ownerGuid` bigint unsigned NOT NULL COMMENT 'Player GUID (account-wide tracking)',
|
||||
`houseDecorId` int unsigned NOT NULL COMMENT 'HouseDecor DB2 entry ID',
|
||||
`quantity` int unsigned NOT NULL DEFAULT '1' COMMENT 'Number of this decor owned/available',
|
||||
`acquiredTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when first acquired',
|
||||
`sourceType` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'DecorSourceType: 0=Standard, 3=Deferred, 5=Spell, 6=Item',
|
||||
`sourceValue` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'Source context (spell ID, item GUID, etc.)',
|
||||
PRIMARY KEY (`ownerGuid`,`houseDecorId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `character_housing_decor` (
|
||||
`ownerGuid` bigint unsigned NOT NULL COMMENT 'FK to character_housing.guid',
|
||||
`id` bigint unsigned NOT NULL COMMENT 'Decor instance ID (unique per owner)',
|
||||
`houseDecorId` int unsigned NOT NULL COMMENT 'HouseDecor DB2 entry ID',
|
||||
`posX` float NOT NULL DEFAULT '0' COMMENT 'X position in room/house coordinates',
|
||||
`posY` float NOT NULL DEFAULT '0' COMMENT 'Y position in room/house coordinates',
|
||||
`posZ` float NOT NULL DEFAULT '0' COMMENT 'Z position in room/house coordinates',
|
||||
`rotX` float NOT NULL DEFAULT '0' COMMENT 'Quaternion rotation X component',
|
||||
`rotY` float NOT NULL DEFAULT '0' COMMENT 'Quaternion rotation Y component',
|
||||
`rotZ` float NOT NULL DEFAULT '0' COMMENT 'Quaternion rotation Z component',
|
||||
`rotW` float NOT NULL DEFAULT '1' COMMENT 'Quaternion rotation W component',
|
||||
`scale` float NOT NULL DEFAULT '1',
|
||||
`dyeSlot0` int unsigned NOT NULL DEFAULT '0' COMMENT 'Dye color ID for slot 0',
|
||||
`dyeSlot1` int unsigned NOT NULL DEFAULT '0' COMMENT 'Dye color ID for slot 1',
|
||||
`dyeSlot2` int unsigned NOT NULL DEFAULT '0' COMMENT 'Dye color ID for slot 2',
|
||||
`roomGuid` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'FK to character_housing_rooms.id (0 = outdoor/unassigned)',
|
||||
`locked` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Whether the decor item is locked in place (1=locked, 0=unlocked)',
|
||||
`placementTime` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when decor was placed (for refund window)',
|
||||
`sourceType` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'DecorSourceType: 0=Standard, 3=Deferred, 5=Spell, 6=Item',
|
||||
`sourceValue` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'Source context (spell ID, item GUID, etc.)',
|
||||
`petGuid` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'Battle pet counter bound to this decor slot (0 = none), HighGuid::BattlePet',
|
||||
`petFlag` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Client-sent flag accompanying the pet binding (CMSG_HOUSING_DECOR_SET_PET)',
|
||||
`parentDecorGuid` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'Counter of the decor this item is stacked on (0 = none)',
|
||||
PRIMARY KEY (`ownerGuid`,`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `character_housing_fixtures` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique fixture assignment ID',
|
||||
`ownerGuid` bigint unsigned NOT NULL COMMENT 'FK to character_housing.guid',
|
||||
`fixturePointId` int unsigned NOT NULL COMMENT 'Predefined fixture point identifier',
|
||||
`fixtureOptionId` int unsigned NOT NULL DEFAULT '0' COMMENT 'Selected fixture option (0 = default)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_owner` (`ownerGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `character_housing_ignored_neighborhood` (
|
||||
`ownerGuid` bigint unsigned NOT NULL COMMENT 'Player character GUID counter',
|
||||
`neighborhoodGuid` bigint unsigned NOT NULL COMMENT 'Ignored neighborhood GUID counter',
|
||||
PRIMARY KEY (`ownerGuid`,`neighborhoodGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `character_housing_rooms` (
|
||||
`ownerGuid` bigint unsigned NOT NULL COMMENT 'FK to character_housing.guid',
|
||||
`id` bigint unsigned NOT NULL COMMENT 'Room instance ID (unique per owner)',
|
||||
`houseRoomId` int unsigned NOT NULL COMMENT 'HouseRoom DB2 entry ID',
|
||||
`slotIndex` int unsigned NOT NULL DEFAULT '0' COMMENT 'Room slot within the house layout',
|
||||
`gridX` int NOT NULL DEFAULT '0',
|
||||
`gridY` int NOT NULL DEFAULT '0',
|
||||
`floorIndex` int NOT NULL DEFAULT '0',
|
||||
`orientation` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Room rotation orientation value',
|
||||
`mirrored` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Boolean: 1 = room layout is mirrored',
|
||||
`themeId` int unsigned NOT NULL DEFAULT '0' COMMENT 'Visual theme applied to the room',
|
||||
`wallTextureId` int unsigned NOT NULL DEFAULT '0' COMMENT 'RoomComponentTexture ID for walls',
|
||||
`floorTextureId` int unsigned NOT NULL DEFAULT '0' COMMENT 'RoomComponentTexture ID for floors',
|
||||
`ceilingTextureId` int unsigned NOT NULL DEFAULT '0' COMMENT 'RoomComponentTexture ID for ceilings',
|
||||
`colorOverride` int NOT NULL DEFAULT '-1' COMMENT 'Color override for materials (-1 = default)',
|
||||
`doorTypeId` int unsigned NOT NULL DEFAULT '0' COMMENT 'Door type for the room',
|
||||
`doorSlot` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Door slot index within the room',
|
||||
`ceilingTypeId` int unsigned NOT NULL DEFAULT '0' COMMENT 'Ceiling type for the room',
|
||||
`ceilingSlot` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Ceiling slot index within the room',
|
||||
`wallThemeId` int unsigned NOT NULL DEFAULT '0',
|
||||
`floorThemeId` int unsigned NOT NULL DEFAULT '0',
|
||||
`ceilingThemeId` int unsigned NOT NULL DEFAULT '0',
|
||||
`doorTypes` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||||
`componentStyles` varchar(1024) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`ownerGuid`,`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_charter_signatures` (
|
||||
`charterId` bigint unsigned NOT NULL COMMENT 'FK to neighborhood_charters.id',
|
||||
`signerGuid` bigint unsigned NOT NULL COMMENT 'Player GUID of the signer',
|
||||
`signTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when the signature was made',
|
||||
PRIMARY KEY (`charterId`,`signerGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_charters` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique charter ID',
|
||||
`creatorGuid` bigint unsigned NOT NULL COMMENT 'Player GUID of the charter creator',
|
||||
`name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Proposed neighborhood name (max HOUSING_MAX_NAME_LENGTH)',
|
||||
`neighborhoodMapId` int unsigned NOT NULL COMMENT 'NeighborhoodMap DB2 entry ID for the target map',
|
||||
`factionFlags` int unsigned NOT NULL DEFAULT '0' COMMENT 'Faction restriction flags for the neighborhood',
|
||||
`isGuild` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Boolean: 1 = guild-associated neighborhood',
|
||||
`createTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp of charter creation',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_creator` (`creatorGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_initiative_contributions` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
`initiativeDbId` bigint unsigned NOT NULL COMMENT 'FK to neighborhood_initiatives.id',
|
||||
`playerGuid` bigint unsigned NOT NULL COMMENT 'Player character GUID',
|
||||
`taskId` int unsigned NOT NULL COMMENT 'InitiativeTask DB2 entry ID',
|
||||
`amount` int unsigned NOT NULL DEFAULT '0' COMMENT 'Cumulative contribution to this task',
|
||||
`lastUpdated` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp of last contribution',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_initiative_player_task` (`initiativeDbId`,`playerGuid`,`taskId`),
|
||||
KEY `idx_player` (`playerGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_initiative_milestones` (
|
||||
`initiativeDbId` bigint unsigned NOT NULL COMMENT 'FK to neighborhood_initiatives.id',
|
||||
`milestoneIndex` int unsigned NOT NULL COMMENT 'Milestone index (0, 1, 2)',
|
||||
`reached` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '1 = milestone has been reached',
|
||||
`reachedTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when milestone was reached',
|
||||
PRIMARY KEY (`initiativeDbId`,`milestoneIndex`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_initiative_reward_claims` (
|
||||
`initiativeDbId` bigint unsigned NOT NULL COMMENT 'FK to neighborhood_initiatives.id',
|
||||
`milestoneIndex` int unsigned NOT NULL COMMENT 'Milestone index (0, 1, 2)',
|
||||
`playerGuid` bigint unsigned NOT NULL COMMENT 'Player character GUID',
|
||||
`claimTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when reward was claimed',
|
||||
PRIMARY KEY (`initiativeDbId`,`milestoneIndex`,`playerGuid`),
|
||||
KEY `idx_player` (`playerGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_initiative_task_progress` (
|
||||
`initiativeDbId` bigint unsigned NOT NULL COMMENT 'FK to neighborhood_initiatives.id',
|
||||
`taskId` int unsigned NOT NULL COMMENT 'InitiativeTask DB2 entry ID',
|
||||
`progress` int unsigned NOT NULL DEFAULT '0' COMMENT 'Current progress count towards TargetCount',
|
||||
`status` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '0=NOT_STARTED, 1=IN_PROGRESS, 2=COMPLETE',
|
||||
PRIMARY KEY (`initiativeDbId`,`taskId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_initiatives` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique initiative instance ID',
|
||||
`neighborhoodGuid` bigint unsigned NOT NULL COMMENT 'FK to neighborhoods.guid',
|
||||
`initiativeId` int unsigned NOT NULL COMMENT 'NeighborhoodInitiative DB2 entry ID',
|
||||
`startTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when the initiative began',
|
||||
`progress` float NOT NULL DEFAULT '0' COMMENT 'Completion progress (0.0 to 1.0)',
|
||||
`completed` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Boolean: 1 = initiative completed',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_neighborhood` (`neighborhoodGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_invites` (
|
||||
`neighborhoodGuid` bigint unsigned NOT NULL COMMENT 'FK to neighborhoods.guid',
|
||||
`inviteeGuid` bigint unsigned NOT NULL COMMENT 'Player GUID of the invited player',
|
||||
`inviterGuid` bigint unsigned NOT NULL COMMENT 'Player GUID of the player who sent the invite',
|
||||
`inviteTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when the invite was sent',
|
||||
PRIMARY KEY (`neighborhoodGuid`,`inviteeGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhood_members` (
|
||||
`neighborhoodGuid` bigint unsigned NOT NULL COMMENT 'FK to neighborhoods.guid',
|
||||
`playerGuid` bigint unsigned NOT NULL COMMENT 'Player GUID of the member',
|
||||
`role` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'NeighborhoodMemberRole: 0=Resident, 1=Manager, 2=Owner',
|
||||
`joinTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp when the player joined',
|
||||
`plotIndex` tinyint unsigned NOT NULL DEFAULT '255' COMMENT 'Assigned plot index (255 = INVALID_PLOT_INDEX, no plot)',
|
||||
PRIMARY KEY (`neighborhoodGuid`,`playerGuid`),
|
||||
KEY `idx_player` (`playerGuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `neighborhoods` (
|
||||
`guid` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique neighborhood instance ID',
|
||||
`name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Neighborhood display name (max HOUSING_MAX_NAME_LENGTH)',
|
||||
`neighborhoodMapId` int unsigned NOT NULL COMMENT 'NeighborhoodMap DB2 entry ID',
|
||||
`ownerGuid` bigint unsigned NOT NULL COMMENT 'Player GUID of the neighborhood founder/owner',
|
||||
`factionRestriction` int NOT NULL DEFAULT '0' COMMENT 'NeighborhoodFactionRestriction: 0=None, 1=Horde, 2=Alliance',
|
||||
`isPublic` tinyint unsigned NOT NULL DEFAULT '0' COMMENT 'Boolean: 1 = publicly listed and joinable',
|
||||
`createTime` int unsigned NOT NULL DEFAULT '0' COMMENT 'Unix timestamp of neighborhood creation',
|
||||
`guildId` int unsigned NOT NULL DEFAULT '0' COMMENT 'M8: owning guild id for guild neighborhoods (0 = not guild-linked)',
|
||||
PRIMARY KEY (`guid`),
|
||||
KEY `idx_owner` (`ownerGuid`),
|
||||
KEY `idx_map` (`neighborhoodMapId`),
|
||||
KEY `idx_guild` (`guildId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
Reference in New Issue
Block a user