Skip to content

Commit

Permalink
updating logging for migration
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnyu committed Jul 3, 2024
1 parent 1f14688 commit ad1b632
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions migration/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func migrateUsersToGorm() error {
for _, userPG := range usersPG {
u := userPG.ToGormModel()
if _, err := database.InsertUser(&u); err != nil {
log.Println("[ERROR] %s", err.Error())
log.Printf("[ERROR] %s", err.Error())
}
}

Expand All @@ -251,7 +251,7 @@ func migrateAccessionsToGorm() error {
for _, accessionPG := range accessionsPG {
a := accessionPG.ToGormModel()
if _, err := database.InsertAccession(&a); err != nil {
log.Println("[ERROR] %s", err.Error())
log.Printf("[ERROR] %s", err.Error())
continue
}
}
Expand All @@ -268,14 +268,14 @@ func migrateEntriesToGorm() error {
e := entryPG.ToGormModel()
c, err := database.FindResource(e.ResourceID)
if err != nil {
log.Println("[ERROR] %s", err.Error())
log.Printf("[ERROR] %s", err.Error())
continue
}

e.RepositoryID = c.RepositoryID

if _, err := database.InsertEntry(&e); err != nil {
log.Println("[ERROR] %s", err.Error())
log.Printf("[ERROR] %s", err.Error())
continue
}
}
Expand All @@ -286,7 +286,7 @@ func migrateCollectionsToGorm() error {

collectionsPG, err := database.GetCollectionsPG()
if err != nil {
log.Println("[ERROR] %s", err.Error())
log.Printf("[ERROR] %s", err.Error())
}

for _, collectionPG := range collectionsPG {
Expand All @@ -302,7 +302,7 @@ func migrateCollectionsToGorm() error {
}

if _, err := database.InsertResource(&c); err != nil {
log.Println("[ERROR] %s", err.Error())
log.Printf("[ERROR] %s", err.Error())
continue
}
}
Expand Down

0 comments on commit ad1b632

Please sign in to comment.