-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (30 loc) · 718 Bytes
/
main.go
File metadata and controls
38 lines (30 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"log"
"time"
epg "github.com/fergusstrange/embedded-postgres"
"gorm.io/driver/postgres"
"gorm.io/gorm"
"vega.spike/entities"
)
func main() {
pg := epg.NewDatabase(epg.DefaultConfig().
Username("beer").
Password("wine").
Database("gin").
Version(epg.V14).
RuntimePath("/home/scotty/work/epg/runtime").
Port(9876).
StartTimeout(45 * time.Second).
Logger(log.Writer()))
pg.Start()
db, err := gorm.Open(postgres.Open("postgres://beer:wine@localhost:9876/gin"))
if err != nil {
log.Fatalln(err)
}
db.AutoMigrate(&entities.Transfer{})
db.AutoMigrate(&entities.Account{})
db.AutoMigrate(&entities.Asset{})
db.AutoMigrate(&entities.Party{})
log.Println("yay")
}