Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmer committed Jan 17, 2025
1 parent 40d12f9 commit 89d181a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions waku/factory/node_factory.nim
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,18 @@ proc setupProtocols(
## Regarding storage, the only diff between the current/future archive driver and the legacy
## one, is that the legacy stores an extra field: the id (message digest.)

## TODO: remove this "migrate" variable once legacy store is removed
## It is now necessary because sqlite's legacy store has an extra field: storedAt
## This breaks compatibility between store's and legacy store's schemas in sqlite
## So for now, we need to make sure that when legacy store is enabled and we use sqlite
## that we migrate our db according to legacy store's schema to have the extra field
var postgres = false
when defined(postgres):
postgres = true

let migrate =
if not postgres and conf.legacyStore: false else: conf.storeMessageDbMigration

let archiveDriverRes = waitFor driver.ArchiveDriver.new(
conf.storeMessageDbUrl, conf.storeMessageDbVacuum, migrate,
conf.storeMaxNumDbConnections, onFatalErrorAction,
Expand Down

0 comments on commit 89d181a

Please sign in to comment.