[PR #2469] [MERGED] fix: use custom TableName() for dump/restore table resolution #5657

Closed
opened 2026-04-16 13:47:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2469
Author: @tink-bot
Created: 3/24/2026
Status: Merged
Merged: 3/24/2026
Merged by: @kolaente

Base: mainHead: fix/dump-table-name-resolution


📝 Commits (2)

  • dbc28c3 fix: use custom TableName() for dump/restore table resolution
  • dcfb091 refactor: use xorm's TableInfo to resolve table names

📊 Changes

1 file changed (+8 additions, -6 deletions)

View changed files

📝 pkg/db/db.go (+8 -6)

📄 Description

RegisteredTableNames() derived table names from Go struct type names via the xorm name mapper, ignoring custom TableName() methods. This caused vikunja dump to query database_notification instead of the actual table notifications, failing with "Table doesn't exist".

Fixes #2464


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2469 **Author:** [@tink-bot](https://github.com/tink-bot) **Created:** 3/24/2026 **Status:** ✅ Merged **Merged:** 3/24/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `fix/dump-table-name-resolution` --- ### 📝 Commits (2) - [`dbc28c3`](https://github.com/go-vikunja/vikunja/commit/dbc28c3f4301d118a4036191c218374dc2ce2950) fix: use custom TableName() for dump/restore table resolution - [`dcfb091`](https://github.com/go-vikunja/vikunja/commit/dcfb0911b5f5c41669a467a0231f7b4204b981d1) refactor: use xorm's TableInfo to resolve table names ### 📊 Changes **1 file changed** (+8 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `pkg/db/db.go` (+8 -6) </details> ### 📄 Description `RegisteredTableNames()` derived table names from Go struct type names via the xorm name mapper, ignoring custom `TableName()` methods. This caused `vikunja dump` to query `database_notification` instead of the actual table `notifications`, failing with "Table doesn't exist". Fixes #2464 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 13:47:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#5657