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 ApiMigration struct {
Db *pg.DB
}
func (am *ApiMigration) Create() {
func (am *ApiMigration) Create() error {
models := []interface{}{
(*models.ApiModel)(nil),
}
@@ -24,8 +24,10 @@ func (am *ApiMigration) Create() {
})
if err != nil {
log.Printf("Error Creating Table: %s", err)
return err
} else {
fmt.Println("Table created successfully")
}
}
return nil
}