added migration route

This commit is contained in:
Fran Jurmanović
2021-05-25 21:36:41 +02:00
parent 7257684d19
commit 8a9759f66e
8 changed files with 50 additions and 11 deletions

View File

@@ -13,7 +13,7 @@ type TransactionsMigration struct {
Db *pg.DB
}
func (am *TransactionsMigration) Create() {
func (am *TransactionsMigration) Create() error {
models := []interface{}{
(*models.Transaction)(nil),
}
@@ -25,8 +25,10 @@ func (am *TransactionsMigration) Create() {
})
if err != nil {
log.Printf("Error Creating Table: %s", err)
return err
} else {
fmt.Println("Table created successfully")
}
}
return nil
}