now seems to work for the most part
This commit is contained in:
@@ -9,12 +9,17 @@ import _ "github.com/lib/pq"
|
||||
var ormObject orm.Ormer
|
||||
|
||||
func Initialize() {
|
||||
if os.Getenv("DEBUG") != "" {
|
||||
orm.Debug = true
|
||||
}
|
||||
|
||||
ConnectToDb()
|
||||
SyncDB()
|
||||
}
|
||||
|
||||
// ConnectToDb - Initializes the ORM and Connection to the postgres DB
|
||||
func ConnectToDb() {
|
||||
|
||||
orm.DefaultTimeLoc = time.UTC
|
||||
|
||||
POSTGRES_DB_URL := os.Getenv("POSTGRES_DB_URL")
|
||||
|
||||
@@ -3,9 +3,10 @@ package models
|
||||
import "time"
|
||||
|
||||
type Merp struct {
|
||||
ID int `json:"id" orm:"auto"`
|
||||
Content string `json:"content" orm:"type(json)"`
|
||||
Created time.Time `orm:"auto_now_add;type(datetime)"`
|
||||
RemoteIP string `json:"remoteIP" orm:"size(128)"`
|
||||
Thing string `json:"thing" orm:"size(128)"`
|
||||
ID int `json:"id" orm:"auto;column(id)"`
|
||||
Content string `json:"content" orm:"type(jsonb);column(content)"`
|
||||
Created time.Time `orm:"auto_now_add;type(datetime);column(created)"`
|
||||
RemoteIP string `json:"remoteIP" orm:"size(128);column(remoteip)"`
|
||||
Thing string `json:"thing" orm:"size(256)"`
|
||||
UUID string `json:"uuid" orm:"size(36);column(uuid)"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user