feat: register Vikunja tables with db package at init

This commit is contained in:
kolaente
2026-03-04 15:26:34 +01:00
parent d26936f869
commit 3dd2ba4aa4
5 changed files with 26 additions and 0 deletions

View File

@@ -35,6 +35,10 @@ func SetEngine() (err error) {
return nil
}
func init() {
db.RegisterTables(GetTables())
}
// GetTables returns all structs which are also a table.
func GetTables() []interface{} {
return []interface{}{

View File

@@ -36,6 +36,10 @@ var (
testUpdatedTime time.Time
)
func init() {
db.RegisterTables(GetTables())
}
// GetTables returns all structs which are also a table.
func GetTables() []interface{} {
return []interface{}{

View File

@@ -16,6 +16,12 @@
package migration
import "code.vikunja.io/api/pkg/db"
func init() {
db.RegisterTables(GetTables())
}
// GetTables returns all structs which are also a table.
func GetTables() []interface{} {
return []interface{}{

View File

@@ -16,6 +16,12 @@
package notifications
import "code.vikunja.io/api/pkg/db"
func init() {
db.RegisterTables(GetTables())
}
// GetTables returns all structs which are also a table.
func GetTables() []interface{} {
return []interface{}{

View File

@@ -16,6 +16,12 @@
package user
import "code.vikunja.io/api/pkg/db"
func init() {
db.RegisterTables(GetTables())
}
// GetTables returns all structs which are also a table.
func GetTables() []interface{} {
return []interface{}{