mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-08 23:03:29 -05:00
feat: register Vikunja tables with db package at init
This commit is contained in:
@@ -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{}{
|
||||
|
||||
@@ -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{}{
|
||||
|
||||
@@ -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{}{
|
||||
|
||||
@@ -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{}{
|
||||
|
||||
@@ -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{}{
|
||||
|
||||
Reference in New Issue
Block a user