Skip to content

Commit

Permalink
No longer select world in getChunkTimestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
Protonull committed Aug 15, 2023
1 parent 6307de4 commit 4f9f3fb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export async function getChunkTimestamps(dimension: string, regions: Pos2D[]) {
db
.selectFrom('player_chunk')
.select([
'world',
(eb) =>
kysely.sql<string>`(cast(floor(${eb.ref(
'chunk_x',
Expand All @@ -107,11 +106,11 @@ export async function getChunkTimestamps(dimension: string, regions: Pos2D[]) {
'chunk_z as z',
(eb) => eb.fn.max('ts').as('timestamp'),
])
.groupBy(['world', 'x', 'z']),
.where('world', '=', dimension)
.groupBy(['x', 'z']),
)
.selectFrom('regions')
.select(['world', 'x as chunkX', 'z as chunkZ', 'timestamp'])
.where('world', '=', dimension)
.select(['x as chunkX', 'z as chunkZ', 'timestamp'])
.where(
'region',
'in',
Expand Down

0 comments on commit 4f9f3fb

Please sign in to comment.