still builds
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-03-27 16:46:47 -07:00
parent 0683cd7b32
commit 84b19fb14e
3 changed files with 19 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ package database
import (
"time"
"git.eeqj.de/sneak/feta/instance"
"github.com/google/uuid"
"github.com/jinzhu/gorm"
@@ -12,12 +13,12 @@ import (
// NB that when you add a model below you must add it to this list!
func (m *Manager) doMigrations() {
m.db.AutoMigrate(&instance{})
m.db.AutoMigrate(&apinstance{})
}
type instance struct {
type apinstance struct {
gorm.Model
Identifier uuid.UUID
ID uuid.UUID `gorm:"type:uuid;primary_key;"`
ErrorCount uint
SuccessCount uint
HighestID int
@@ -32,6 +33,9 @@ type instance struct {
ServerImplementationString string
}
func (m *Manager) ListInstances() {
func (m *Manager) ListInstances() ([]*instance.Instance, error) {
output := make([]*instance.Instance, 0)
// FIXME have this produce a list of Instance
return output, nil
}

View File

@@ -23,6 +23,10 @@ func New() *Manager {
}
func (m *Manager) init() {
m.db.LogMode(false)
if viper.GetBool("Debug") {
m.db.LogMode(true)
}
m.open()
}