Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions server/src/models/Pokestop.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ module.exports = class Pokestop extends Model {
hasMultiInvasions,
multiInvasionMs,
hasRewardAmount,
hasLayerColumn,
},
) {
const {
Expand Down Expand Up @@ -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) > ${
Expand Down
6 changes: 6 additions & 0 deletions server/src/services/DbCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => [
Expand All @@ -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
}
})
})
Expand Down