sql: consolidar en web-next/sql y tirar lo del foro viejo

Repaso de la carpeta sql/ heredada. De sus 8 ficheros:

- forum_schema.sql y forum_views.sql: SE BORRAN. Son del foro anterior, que
  af707ad reemplazó por el port de FusionCMS (web-next/sql/forum_fusion.sql).
  El primero crea `forums`, tabla que ya no existe (el código usa forum_forums);
  el segundo añade un contador `views` que ni existe en prod ni usa el código.
  Quedan en el historial por si hicieran falta.
- achievement_points.sql, battlepay_sumup.sql, seed_news.sql y
  seed_recruit_rewards.sql: siguen siendo válidos y se mueven a web-next/sql/,
  que es la carpeta viva. El primero pasa a achievement_points_world.sql para no
  chocar con la copia de django_wow que usa la armería; cada uno avisa del otro.
- rename_home_prefix.sql y drop_home_securitytoken_authuser_fk.sql: se quedan en
  sql/ como registro de migraciones ya aplicadas.

Se añade battlepay_purchases.sql: la tabla la escribe el core y no estaba en
ningún SQL, así que no había forma de recrearla. Sus 61 filas son de pruebas
locales (2 cuentas, 127.0.0.1), sin datos de jugadores.

Verificado importando todo en BD limpias: seed_news deja 50 noticias,
seed_recruit_rewards 6, battlepay_sumup crea sus 2 tablas y
battlepay_purchases reproduce prod fila a fila con el mismo esquema.
This commit is contained in:
2026-07-16 21:29:12 +00:00
parent 9caa7b6c92
commit 476e5dba87
8 changed files with 28 additions and 76 deletions
-68
View File
@@ -1,68 +0,0 @@
-- Esquema del foro para la base de datos `acore_web` (NovaWoW).
-- Extraído de NovaWeb-main. Aplicar sobre acore_web.
CREATE TABLE `forum_categories` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`order` int NOT NULL DEFAULT '0',
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_order` (`order`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `forums` (
`id` int NOT NULL AUTO_INCREMENT,
`category_id` int NOT NULL,
`order` int NOT NULL DEFAULT '0',
`name` varchar(45) NOT NULL,
`description` text NOT NULL,
`icon` varchar(45) DEFAULT NULL,
`colortitle` varchar(45) DEFAULT NULL,
`type` int NOT NULL DEFAULT '1',
`visibility` tinyint(1) NOT NULL DEFAULT '1',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8mb3;
CREATE TABLE `forum_topics` (
`id` int NOT NULL AUTO_INCREMENT,
`forum_id` int NOT NULL,
`name` varchar(45) NOT NULL,
`poster` varchar(32) NOT NULL,
`poster_id` int unsigned NOT NULL,
`created` timestamp NOT NULL DEFAULT (now()),
`sticky` tinyint NOT NULL DEFAULT '0',
`locked` tinyint NOT NULL DEFAULT '0',
`deleted` tinyint NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`moved` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb3;
CREATE TABLE `forum_posts` (
`id` int NOT NULL AUTO_INCREMENT,
`topic_id` int NOT NULL,
`poster` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
`text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deleted` tinyint NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`poster_id` int unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE `forum_reads` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`user_id` int unsigned NOT NULL,
`topic_id` int unsigned NOT NULL,
`read_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_user_topic` (`user_id`,`topic_id`),
KEY `idx_user_id` (`user_id`),
KEY `idx_topic_id` (`topic_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-4
View File
@@ -1,4 +0,0 @@
-- Contador de visitas por tema (opcional). Aplicar sobre la base `acore_web`.
-- El foro funciona sin esta columna (detección automática); aplícala para
-- activar el contador de visitas.
ALTER TABLE `forum_topics` ADD COLUMN `views` INT NOT NULL DEFAULT 0;
+1 -1
View File
@@ -2,7 +2,7 @@
-- la ficha de personaje de la armería: SUM(points) sobre character_achievement.
-- Generado desde el DB2 Achievement del build 3.4.3.54261 (wago.tools).
--
-- OJO: existe otra copia de esta misma tabla en acore_world (ver sql/achievement_points.sql),
-- OJO: existe otra copia de esta misma tabla en acore_world (ver web-next/sql/achievement_points_world.sql),
-- que es la que usa el «Top de logros» de /<realm>-players con un JOIN entre BD.
-- Si se regeneran los puntos, hay que actualizar LAS DOS.
--
@@ -1,6 +1,8 @@
-- Puntos de logros (achievement_points) para el «Top de logros» de /<realm>-players.
-- Generado desde el DB2 Achievement del build 3.4.3.54261 (wago.tools).
-- Aplicar: mysql < sql/achievement_points.sql (crea acore_world.achievement_points id→points).
-- Aplicar: mysql < web-next/sql/achievement_points_world.sql (crea acore_world.achievement_points id→points).
-- OJO: la armería usa OTRA copia de esta tabla en django_wow (achievement_points.sql).
-- Si se regeneran los puntos, hay que actualizar LAS DOS.
-- La web hace SUM(points) uniendo acore_characters.character_achievement.achievement = id.
CREATE TABLE IF NOT EXISTS acore_world.achievement_points (id INT NOT NULL PRIMARY KEY, points INT NOT NULL DEFAULT 0);
TRUNCATE acore_world.achievement_points;
+22
View File
@@ -0,0 +1,22 @@
-- Historial de compras de la tienda nativa (battlepay) del cliente, en acore_auth.
-- La escribe el core (worldserver), no la web; se versiona para poder recrear la
-- tabla, que no venía en ningún SQL del repo. Ver también battlepay_sumup.sql.
--
-- Las filas son de las PRUEBAS locales (2 cuentas, RemoteAddress 127.0.0.1);
-- no hay datos de jugadores reales. Si algún día los hubiera, NO volcarlos aquí.
--
-- Aplicar: mysql acore_auth < web-next/sql/battlepay_purchases.sql
SET NAMES utf8mb4;
DROP TABLE IF EXISTS `battlepay_purchases`;
CREATE TABLE `battlepay_purchases` (
`id` int unsigned NOT NULL,
`battlenetAccountId` int unsigned NOT NULL,
`realm` int unsigned NOT NULL,
`productID` int unsigned NOT NULL,
`productName` varchar(255) NOT NULL,
`CurrentPrice` int unsigned NOT NULL,
`RemoteAddress` varchar(50) NOT NULL,
`delivered` tinyint unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
INSERT INTO `battlepay_purchases` VALUES (38,1,16842753,4,'X-51 Nether-Rocket X-TREME',200000,'127.0.0.1',1),(39,1,16842753,4,'X-51 Nether-Rocket X-TREME',200000,'127.0.0.1',1),(41,1,16842753,5,'Avatar of Flame',250000,'127.0.0.1',1),(42,1,16842753,7,'Kalu\'ak Whalebone Glider',200000,'127.0.0.1',1),(43,1,16842753,9,'Black Ram',200000,'127.0.0.1',1),(45,1,16842753,17,'Teal Kodo',200000,'127.0.0.1',1),(46,1,16842753,19,'Whistle of the Mottled Red Raptor',200000,'127.0.0.1',1),(47,1,16842753,20,'White Mechanostrider Mod B',200000,'127.0.0.1',1),(48,1,16842753,21,'Big Battle Bear',200000,'127.0.0.1',1),(49,1,16842753,22,'Big Blizzard Bear',200000,'127.0.0.1',1),(50,1,16842753,25,'Magic Rooster Egg',200000,'127.0.0.1',1),(51,1,16842753,27,'Reins of the Swift Spectral Tiger',200000,'127.0.0.1',1),(52,1,16842753,31,'Pebble\'s Pebble',200000,'127.0.0.1',1),(53,1,16842753,32,'Pinchy the Plunderer',200000,'127.0.0.1',1),(54,1,16842753,32,'Pinchy the Plunderer',200000,'127.0.0.1',1),(55,1,16842753,33,'Glub',200000,'127.0.0.1',1),(56,1,16842753,33,'Glub',200000,'127.0.0.1',1),(57,1,16842753,35,'Zergling Leash',200000,'127.0.0.1',1),(58,1,16842753,37,'Core Hound Pup',200000,'127.0.0.1',1),(59,1,16842753,38,'Pink Murloc Egg',200000,'127.0.0.1',1),(60,1,16842753,42,'Baby Shark',200000,'127.0.0.1',1),(61,1,16842753,51,'Green Dragon Orb',200000,'127.0.0.1',1),(62,1,16842753,68,'XS-001 Constructor Bot',200000,'127.0.0.1',1),(63,1,16842753,58,'Pandaren Monk',200000,'127.0.0.1',1),(64,1,16842753,69,'Fishspeaker\'s Lucky Lure',200000,'127.0.0.1',1),(66,1,16842753,69,'Fishspeaker\'s Lucky Lure',200000,'127.0.0.1',1),(67,1,16842753,70,'Dark Portal',200000,'127.0.0.1',1),(68,1,16842753,72,'Foam Sword Rack',200000,'127.0.0.1',1),(69,1,16842753,72,'Foam Sword Rack',200000,'127.0.0.1',1),(70,1,16842753,74,'Ethereal Portal',200000,'127.0.0.1',1),(71,1,16842753,75,'Path of Illidan',200000,'127.0.0.1',1),(72,1,16842753,82,'Paper Flying Machine Kit',200000,'127.0.0.1',1),(74,1,16842753,76,'Fishing Chair',200000,'127.0.0.1',1),(75,1,16842753,73,'D.I.S.C.O.',200000,'127.0.0.1',1),(76,1,16842753,83,'Picnic Basket',200000,'127.0.0.1',1),(77,1,16842753,1,'Name Change',100000,'127.0.0.1',0),(78,1,16842753,1,'Name Change',100000,'127.0.0.1',0),(79,1,16842753,2,'Race Change',150000,'127.0.0.1',0),(80,1,16842753,28,'Riding Turtle',200000,'127.0.0.1',1),(81,1,16842753,23,'Blazing Hippogryph',200000,'127.0.0.1',1),(82,1,16842753,66,'Warbot Ignition Key',200000,'127.0.0.1',1),(83,1,16842753,28,'Riding Turtle',200000,'127.0.0.1',1),(84,1,16842753,12,'Green Kodo',200000,'127.0.0.1',1),(85,1,16842753,29,'Swift Zhevra',200000,'127.0.0.1',1),(86,1,16842753,30,'X-51 Nether-Rocket',200000,'127.0.0.1',1),(87,1,16842753,10,'Celestial Steed',200000,'127.0.0.1',1),(88,1,16842753,1,'Name Change',100000,'127.0.0.1',0),(89,1,16842753,57,'Onyxian Whelpling',200000,'127.0.0.1',1),(90,1,16842753,29,'Swift Zhevra',200000,'127.0.0.1',1),(91,1,16842753,14,'Icy Blue Mechanostrider Mod A',200000,'127.0.0.1',1),(92,1,16842753,4,'X-51 Nether-Rocket X-TREME',200000,'127.0.0.1',1),(93,1,16842753,23,'Blazing Hippogryph',200000,'127.0.0.1',1),(94,1,16842753,10,'Celestial Steed',200000,'127.0.0.1',1),(95,1,16842753,10,'Celestial Steed',200000,'127.0.0.1',1),(96,1,16842753,10,'Celestial Steed',200000,'127.0.0.1',1),(97,2,16842753,70,'Dark Portal',200000,'127.0.0.1',1),(98,2,16842753,5,'Avatar of Flame',250000,'127.0.0.1',1),(99,1,16842753,10,'Celestial Steed',200000,'127.0.0.1',1),(100,2,16842753,1,'Name Change',100000,'127.0.0.1',0),(101,2,16842753,2,'Race Change',150000,'127.0.0.1',0),(103,1,16842753,3,'Faction Change',160000,'127.0.0.1',0);
@@ -1,5 +1,5 @@
-- Siembra de las 50 noticias reales de NovaWoW/UltimoWoW en django_wow.noticia.
-- Aplicar: mysql django_wow < sql/seed_news.sql (BD por defecto del portal).
-- Aplicar: mysql django_wow < web-next/sql/seed_news.sql (BD por defecto del portal).
-- fecha_publicacion = fecha del post a las 12:00 menos N segundos por índice
-- (preserva el orden de la lista dentro de una misma fecha). enlace = NULL
-- (los enlaces al foro van dentro de `contenido`, que es HTML).
@@ -1,5 +1,5 @@
-- Recompensas de Recluta a un amigo (recruitreward) para el panel de /recruit.
-- Aplicar: mysql django_wow < sql/seed_recruit_rewards.sql
-- Aplicar: mysql django_wow < web-next/sql/seed_recruit_rewards.sql
SET NAMES utf8mb4;
INSERT INTO recruitreward (required_friends, reward_name, item_id, item_quantity, item_link, icon_class) VALUES
(1,'Medallón de oro',37297,1,'https://wotlk.ultimowow.com/?item=37297','q3 inv_jewelry_amulet_03'),