mirror of
https://github.com/docmost/docmost.git
synced 2025-11-18 22:01:11 +10:00
fix: enforce C collation for page position ordering to ensure consistent behavior in Postgres 17+ (#1446)
- Add explicit C collation to position ordering queries to fix incorrect page placement in PostgreSQL 17+ - Ensures consistent ASCII-based ordering regardless of database locale settings - Fixes issue where new pages were incorrectly placed at random positions instead of bottom
This commit is contained in:
@ -178,7 +178,7 @@ export class ImportService {
|
||||
.selectFrom('pages')
|
||||
.select(['id', 'position'])
|
||||
.where('spaceId', '=', spaceId)
|
||||
.orderBy('position', 'desc')
|
||||
.orderBy('position', (ob) => ob.collate('C').desc())
|
||||
.limit(1)
|
||||
.where('parentPageId', 'is', null)
|
||||
.executeTakeFirst();
|
||||
|
||||
Reference in New Issue
Block a user