SQLite Forum

Suggestion for sqldiff
Login
Yet another option for dealing with your particular annoyance:

If sqldiff is invoked as usual, but with this additional invocation argument:<code>
  --debug 2
</code>, then it blats the differencing SQL instead of the differences. That can be collected (as edited_sqldiff.sql), edited then used thusly in the sqlite3 CLI shell:<code>
  .open MY_BaseDB
  attach MY_NewerDB as aux
  .output migrate_BaseNewer.sql
  .read edited_sqldiff.sql
  .output stdout
  .quit
</code>. The edited_sqldiff.sql is almost what sqldiff --debug 2 emits, except that it will have some lines reading:<code>
 SQL for TableWhatever:
</code>which must be removed before it deserves the .sql extension.

Once that CLI shell session is run, the migrate_BaseNewer.sql file will contain SQL which, if applied to MY_BaseDB, will alter it to be equivalent to MY_NewerDB . It would be relatively easy to edit edited_sqldiff.sql so that any columns you wish to be ignored are not mentioned in value comparisons. Specifically (and most easily), all expressions resembling "A.noisyCol IS NOT B.noisyCol" can just become "0" (sans quotes.)

This may look like a lot of fuss, but the collection of and edits upon edited_sqldiff.sql need be done only once with repeats for schema changes.