migration: default to sqlite and surface flag defaults in -h#84
Open
0xfandom wants to merge 1 commit intolightninglabs:mainfrom
Open
migration: default to sqlite and surface flag defaults in -h#840xfandom wants to merge 1 commit intolightninglabs:mainfrom
0xfandom wants to merge 1 commit intolightninglabs:mainfrom
Conversation
`migrate-db` previously defaulted `--dest.backend` to `postgres`, even though LND is moving to sqlite as the default backend for new nodes. Switch the destination default to sqlite so users without a postgres server can run `lndinit migrate-db` without an extra flag. Mention the `--chunk-size` default (20MB) and ceiling (500MB) in the flag description so they show up in `-h`. Refresh the help block in `docs/data-migration.md` to include the existing `data-dir` / `tower-dir` defaults that go-flags already prints at runtime, and the new `--dest.backend` and `--chunk-size` defaults.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--dest.backenddefault frompostgrestosqliteso users on a fresh box without a postgres server can runlndinit migrate-db -n <network>without an extra flag. Matches LND's planned default backend.--chunk-sizedefault (20MB) and ceiling (500MB) in the flag description (the ceiling is enforced bymigratekvdb.MaxChunkSize, the default bymigratekvdb.DefaultChunkSize).docs/data-migration.mdso the rendered(default: ...)fordata-dir/tower-dir(already auto-populated by go-flags from the programmaticdefaultDataDir) and the new--dest.backend/--chunk-sizedefaults are reflected in the docs.Testing
make buildclean.go test -tags="kvdb_etcd kvdb_postgres kvdb_sqlite" ./...clean (thecmd_migrate_db_postgres_test.gosuite explicitly setsBackend: lncfg.PostgresBackend, so the default flip does not affect coverage).golangci-lint run --build-tags="kvdb_etcd kvdb_postgres kvdb_sqlite" --timeout 10m ./...clean.lndinit-debug migrate-db -houtput to confirm(default: sqlite), the chunk-size description, and the auto-populated data-dir / tower-dir defaults are all present.Related
Closes #75