Skip to content

Commit 20c5043

Browse files
authored
Fix transaction not being committed (#8)
1 parent 0ff9ee0 commit 20c5043

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ test:
1717
go test ./... -v
1818

1919
test-db:
20-
docker-compose up
20+
docker-compose up
21+
22+
down:
23+
docker-compose down --volumes

cmd/migrate.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ var migrateCmd = &cobra.Command{
7878
logger.Info("Migration succeeded!")
7979
}
8080

81+
err = tx.Commit()
82+
if err != nil {
83+
return logger.Fatalf("Failed to commit migrations! Error: %s", err.Error())
84+
}
85+
8186
logger.Infof("Applied %d migrations successfully!", len(migrations))
8287
return nil
8388
},

0 commit comments

Comments
 (0)