Created
February 26, 2025 02:14
-
-
Save nad2000/f54f6085a203ee5286b6160561409306 to your computer and use it in GitHub Desktop.
How to delete Sqlite3 records that violatie referencial integrity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlite3 db.sqlite3 'pragma foreign_key_check;' | tail -n +3 | sed 's/\(\w*\)\s*\(\w*\).*/delete from \1 where id=\2;/' | sqlite3 db.sqlite3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment