Skip to content

Commit

Permalink
sqlite: Prevent the execution of 'migrate' script if user_version==0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status committed Sep 13, 2023
1 parent e860202 commit 605b04e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions waku/common/databases/db_sqlite.nim
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,11 @@ proc migrate*(db: SqliteDatabase,
## NOTE: Down migration it is not currently supported
let userVersion = ?db.getUserVersion()

if userVersion == targetVersion:
if userVersion == targetVersion or
userVersion == 0'i64: ## https://github.com/waku-org/nwaku/issues/2027
debug "database schema is up to date", userVersion=userVersion, targetVersion=targetVersion
return ok()

info "database schema is outdated", userVersion=userVersion, targetVersion=targetVersion

# Load migration scripts
Expand Down

0 comments on commit 605b04e

Please sign in to comment.