You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(database): exclude derived FTS search tables and generated columns from JSON export and import #1273
Schema 115 (#1204) added external-content FTS5 virtual tables (orders_search_fts, customers_search_fts) and their SQLite FTS5 shadow tables (*_fts_data, *_fts_idx, *_fts_docsize, *_fts_config). While getTables(db) in main/db.ts:2440 excludes virtual and FTS shadow tables, GET /api/db/export (main/routes/database.ts:93) queries raw sqlite_master tables and exports all 10 FTS virtual/shadow tables (plus customers.phone_digits virtual generated column). Re-importing that JSON via POST /api/db/import fails with SqliteError: table orders_search_fts_data may not be modified (or cannot INSERT into generated column "phone_digits").
Acceptance Criteria
Reuse canonical getTables(db) (and stored getTableColumns(db, tableName)) in GET /api/db/export so derived FTS virtual/shadow tables and virtual generated columns are excluded from exports while preserving EXPORT_EXCLUDE_TABLES and secret redaction.
Filter incoming tables in POST /api/db/import against getTables(db) and always intersect imported columns with getTableColumns(db, tableName) so existing schema 115 exports containing *_search_fts* shadow tables or customers.phone_digits import cleanly in both overwrite: true and overwrite: false modes, followed by rebuildSearchIndex(db) and executeSequenceRepair(db).
Add full export -> overwrite and merge import round-trip tests at schema 115, schema 114 -> 115 import tests, contaminated schema 115 export tests, FTS searchability checks, and rollback sentinel checks.
Activity
fix(db): validate append-order inventory chains and exclude virtual t…
fix(main): validate inventory in append order and sanitize json expor…