mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-09 07:13:35 -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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
db.RegisterTables(GetTables())
|
||||||
|
}
|
||||||
|
|
||||||
// GetTables returns all structs which are also a table.
|
// GetTables returns all structs which are also a table.
|
||||||
func GetTables() []interface{} {
|
func GetTables() []interface{} {
|
||||||
return []interface{}{
|
return []interface{}{
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ var (
|
|||||||
testUpdatedTime time.Time
|
testUpdatedTime time.Time
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
db.RegisterTables(GetTables())
|
||||||
|
}
|
||||||
|
|
||||||
// GetTables returns all structs which are also a table.
|
// GetTables returns all structs which are also a table.
|
||||||
func GetTables() []interface{} {
|
func GetTables() []interface{} {
|
||||||
return []interface{}{
|
return []interface{}{
|
||||||
|
|||||||
@@ -16,6 +16,12 @@
|
|||||||
|
|
||||||
package migration
|
package migration
|
||||||
|
|
||||||
|
import "code.vikunja.io/api/pkg/db"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
db.RegisterTables(GetTables())
|
||||||
|
}
|
||||||
|
|
||||||
// GetTables returns all structs which are also a table.
|
// GetTables returns all structs which are also a table.
|
||||||
func GetTables() []interface{} {
|
func GetTables() []interface{} {
|
||||||
return []interface{}{
|
return []interface{}{
|
||||||
|
|||||||
@@ -16,6 +16,12 @@
|
|||||||
|
|
||||||
package notifications
|
package notifications
|
||||||
|
|
||||||
|
import "code.vikunja.io/api/pkg/db"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
db.RegisterTables(GetTables())
|
||||||
|
}
|
||||||
|
|
||||||
// GetTables returns all structs which are also a table.
|
// GetTables returns all structs which are also a table.
|
||||||
func GetTables() []interface{} {
|
func GetTables() []interface{} {
|
||||||
return []interface{}{
|
return []interface{}{
|
||||||
|
|||||||
@@ -16,6 +16,12 @@
|
|||||||
|
|
||||||
package user
|
package user
|
||||||
|
|
||||||
|
import "code.vikunja.io/api/pkg/db"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
db.RegisterTables(GetTables())
|
||||||
|
}
|
||||||
|
|
||||||
// GetTables returns all structs which are also a table.
|
// GetTables returns all structs which are also a table.
|
||||||
func GetTables() []interface{} {
|
func GetTables() []interface{} {
|
||||||
return []interface{}{
|
return []interface{}{
|
||||||
|
|||||||
Reference in New Issue
Block a user