diff --git a/server/src/models/Pokestop.js b/server/src/models/Pokestop.js index 3dc6a02c8..c929a9002 100644 --- a/server/src/models/Pokestop.js +++ b/server/src/models/Pokestop.js @@ -59,6 +59,7 @@ module.exports = class Pokestop extends Model { hasMultiInvasions, multiInvasionMs, hasRewardAmount, + hasLayerColumn, }, ) { const { @@ -110,6 +111,9 @@ module.exports = class Pokestop extends Model { 'incident_expire_timestamp', ), ]) + if (hasLayerColumn) { + query.select('layer AS with_ar') + } if (hideOldPokestops) { query.whereRaw( `UNIX_TIMESTAMP(last_updated) > ${ diff --git a/server/src/services/DbCheck.js b/server/src/services/DbCheck.js index 58194754b..122627991 100644 --- a/server/src/services/DbCheck.js +++ b/server/src/services/DbCheck.js @@ -85,6 +85,11 @@ module.exports = class DbCheck { 'quest_reward_amount' in columns || isMad, 'alternative_quest_type' in columns, ]) + const [hasLayerColumn] = isMad + ? await schema('trs_quest') + .columnInfo() + .then((columns) => ['layer' in columns]) + : [false] const [hasMultiInvasions, multiInvasionMs] = await schema('incident') .columnInfo() .then((columns) => [ @@ -108,6 +113,7 @@ module.exports = class DbCheck { this.models[category][j].hasMultiInvasions = hasMultiInvasions this.models[category][j].multiInvasionMs = multiInvasionMs this.models[category][j].availableSlotsCol = availableSlotsCol + this.models[category][j].hasLayerColumn = hasLayerColumn } }) })