[Spawn] Split spawn2 enabled into its own state table (#3664)

* [Spawn] Split spawn2 enabled into its own state table

* Update spawn2.cpp

* Update repo

* Make spawn2 enabled/disabled instance aware

* Update questmgr.cpp

* Make sure packet stuff is aware of instance_id

* Update questmgr.cpp

* Update database_update_manifest.cpp

* Cleanup

* Revert "Cleanup"

This reverts commit 64b58bfc52.

* Update database_instances.cpp
This commit is contained in:
Chris Miles
2023-11-06 17:34:42 -06:00
committed by GitHub
parent fad9599642
commit 0811a899d1
13 changed files with 552 additions and 106 deletions
@@ -4995,6 +4995,26 @@ ADD COLUMN `id` int(11) NOT NULL AUTO_INCREMENT FIRST,
DROP PRIMARY KEY,
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE INDEX(`varname`);
)"
},
ManifestEntry{
.version = 9241,
.description = "2023_10_29_split_spawn2_enabled.sql",
.check = "SHOW TABLES LIKE 'spawn2_disabled'",
.condition = "empty",
.match = "",
.sql = R"(
CREATE TABLE `spawn2_backup_2023_10_29` LIKE `spawn2`;
CREATE TABLE `spawn2_disabled` (
`id` bigint(11) NOT NULL AUTO_INCREMENT,
`spawn2_id` int(11) DEFAULT NULL,
`instance_id` int(11) DEFAULT 0,
`disabled` smallint(11) DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `spawn2_id` (`spawn2_id`,`instance_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
INSERT INTO spawn2_disabled (spawn2_id, disabled) SELECT id, 1 FROM spawn2 WHERE enabled = 0;
ALTER TABLE `spawn2` DROP COLUMN `enabled`;
)"
},