Skip to content

Commit

Permalink
Allow schema_version not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
waybackarchiver committed Aug 25, 2024
1 parent 438d3da commit 060d1c5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions storage/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ func NewConnectionPool(dsn string, minConnections, maxConnections int, connectio
// nolint: errcheck
func Migrate(db *sql.DB) error {
var currentVersion int
err := db.QueryRow(`SELECT version FROM schema_version`).Scan(&currentVersion)
if err != nil {
return fmt.Errorf("store: migrate failed: %v", err)
}
db.QueryRow(`SELECT version FROM schema_version`).Scan(&currentVersion)

for version := currentVersion; version < schemaVersion; version++ {
newVersion := version + 1
Expand Down

0 comments on commit 060d1c5

Please sign in to comment.