refresh
Read the live schema and write it to the state store. Use this to seed or repair state.
nschema refreshIt captures the whole schema and so takes no desired-schema or --scope options.
Refresh is how you record drift that happened between applies, or initialize the state store with the current schema before you start managing a database offline.
A refresh that finds an existing state payload it cannot read fails rather than overwriting it. The payload can still be
pulled for repair, or you can pass --force to replace it, which resets therun-once script ledger.
Restore the ledger afterwards with script untaint.
Options
Section titled “Options”--no-lock— skip taking the state-store lock for this run. Use it only when you’ve coordinated access by other means (for example you already hold the lock vianschema lock acquire).--force— replace an existing state payload that cannot be read, resetting the script ledger.