File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package database
33import (
44 "net/url"
55
6+ "github.com/machinefi/sprout-pebble-sequencer/pkg/models"
67 "github.com/xoctopus/datatypex"
78 "gorm.io/driver/postgres"
89 "gorm.io/gorm"
@@ -22,7 +23,7 @@ func (d *Postgres) SetDefault() {
2223 Host : "127.0.0.1" ,
2324 Port : 5432 ,
2425 Base : "pebble" ,
25- Param : url.Values {"sslmode" : []string {"disable" }},
26+ Param : url.Values {"sslmode" : []string {"disable" }, "search_path" : [] string { "newpebble" } },
2627 }
2728 }
2829}
@@ -34,6 +35,21 @@ func (d *Postgres) Init() error {
3435 if err != nil {
3536 return err
3637 }
38+
39+ if err := db .AutoMigrate (
40+ & models.Account {},
41+ & models.App {},
42+ & models.AppV2 {},
43+ & models.Bank {},
44+ & models.BankRecord {},
45+ & models.Device {},
46+ & models.DeviceRecord {},
47+ & models.Task {},
48+ & models.Message {},
49+ ); err != nil {
50+ return err
51+ }
52+
3753 d .DB = db
3854 return nil
3955}
You can’t perform that action at this time.
0 commit comments