From be6431ac13cafae5d04b63abd1a58844ed3a20f2 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:13:45 +1000 Subject: [PATCH] Fix parent/child tag sort order (#5320) --- pkg/sqlite/table.go | 4 +++- pkg/sqlite/tables.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/sqlite/table.go b/pkg/sqlite/table.go index 8d72bdcae..80d6b718a 100644 --- a/pkg/sqlite/table.go +++ b/pkg/sqlite/table.go @@ -167,7 +167,9 @@ func (t *joinTable) invert() *joinTable { table: t.table.table, idColumn: t.fkColumn, }, - fkColumn: t.table.idColumn, + fkColumn: t.table.idColumn, + foreignTable: t.foreignTable, + orderBy: t.orderBy, } } diff --git a/pkg/sqlite/tables.go b/pkg/sqlite/tables.go index 74a5ebe69..481c4ee06 100644 --- a/pkg/sqlite/tables.go +++ b/pkg/sqlite/tables.go @@ -333,7 +333,9 @@ var ( table: tagRelationsJoinTable, idColumn: tagRelationsJoinTable.Col(tagChildIDColumn), }, - fkColumn: tagRelationsJoinTable.Col(tagParentIDColumn), + fkColumn: tagRelationsJoinTable.Col(tagParentIDColumn), + foreignTable: tagTableMgr, + orderBy: tagTableMgr.table.Col("name").Asc(), } tagsChildTagsTableMgr = *tagsParentTagsTableMgr.invert()