From e9e0542d15ce76683a41a20dcc4bead9547a0c0d Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Sun, 16 Jul 2023 06:57:19 -0700 Subject: [PATCH] Created Steps to create sql diff of two database versions (markdown) --- ...create-sql-diff-of-two-database-versions.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Steps-to-create-sql-diff-of-two-database-versions.md diff --git a/Steps-to-create-sql-diff-of-two-database-versions.md b/Steps-to-create-sql-diff-of-two-database-versions.md new file mode 100644 index 0000000..f3f9dee --- /dev/null +++ b/Steps-to-create-sql-diff-of-two-database-versions.md @@ -0,0 +1,18 @@ +- Install GNU diff (On current macOS versions, Apple ships FreeBSD though it used to ship GNU at least as 10.15) + +`brew install diffutils` + +then use `/opt/homebrew/bin/diff` as the diff command + +- Extract schema from SQLite database: + +`sqlite3 tests/Test-10.16.0.1.photoslibrary/database/Photos.sqlite ".schema" | sort > sql_11_0_1.sql` + +- Do same for second database + +- Then format (prettify) in VSCode (need way to do this on command line) + +- Create the diff: + +`diff --new-line-format='+%L' --old-line-format='-%L' --unchanged-line-format=' %L' sql_11_0_1.sql 12_0_1.sql >sql_diff.txt` +