oneliner to delete SQLite tables

1
echo ".tables" | python manage.py dbshell | tr " " "\n" | grep myapp | sed 's/^/DROP TABLE /g' | sed 's/$/;/g' | python manage.py dbshell

More like this

  1. grep and delete sqlite tables by kifkif 3 years, 6 months ago
  2. Drop all tables in MySQL database by mpasternacki 3 years, 4 months ago
  3. fast table flush without raw SQL by dsblank 3 years, 6 months ago
  4. Creating MySQL Alter table commands for Foreign Keys by vidyanand 5 years ago
  5. Table Creation Using ORM Standalone by EliAndrewC 5 years, 4 months ago

Comments

kifkif (on December 7, 2009):

Improved version here

#

(Forgotten your password?)