TsubakiBotPad / pad-data-pipeline

Original repo: https://github.com/nachoapps/dadguide-data
9 stars 2 forks source link

Add gungho_id #472

Closed chasehult closed 1 year ago

chasehult commented 1 year ago
ALTER TABLE monsters ADD COLUMN gungho_id_jp int(11) AFTER monster_no_kr;
ALTER TABLE monsters ADD COLUMN gungho_id_na int(11) AFTER gungho_id_jp;
ALTER TABLE monsters ADD COLUMN gungho_id_kr int(11) AFTER gungho_id_na;
CREATE OR REPLACE VIEW `canonical_monster_ids` AS select `t`.`monster_no` AS `monster_no`,`t`.`server_id` AS `server_id`,`t`.`monster_id` AS `monster_id` from (select `dadguide`.`monsters`.`gungho_id_jp` AS `monster_no`,`dadguide`.`monsters`.`monster_id` AS `monster_id`,0 AS `server_id` from `dadguide`.`monsters` union select `dadguide`.`monsters`.`gungho_id_na` AS `monster_no`,`dadguide`.`monsters`.`monster_id` AS `monster_id`,1 AS `server_id` from `dadguide`.`monsters` union select `dadguide`.`monsters`.`gungho_id_kr` AS `monster_no`,`dadguide`.`monsters`.`monster_id` AS `monster_id`,2 AS `server_id` from `dadguide`.`monsters`) `t` where (`t`.`monster_no` is not null);