Skip to content

PERSISTENCE_FORMAT_VERSION

const PERSISTENCE_FORMAT_VERSION: 7 = 7

Defined in: packages/@livestore/sync-cf/src/cf-worker/shared.ts:92

CRITICAL: Increment this version whenever you modify the database schema structure.

Bump required when:

  • Adding/removing/renaming columns in eventlogTable or contextTable (see sqlite.ts)
  • Changing column types or constraints
  • Modifying primary keys or indexes

Bump NOT required when:

  • Changing query patterns, pagination logic, or streaming behavior
  • Adding new tables (as long as existing table schemas remain unchanged)
  • Updating implementation details in sync-storage.ts

Impact: Changing this version triggers a “soft reset” - new table names are created and old data becomes inaccessible (but remains in storage).