Login

oneliner to delete SQLite tables

Author:
kifkif
Posted:
October 26, 2009
Language:
SQL
Version:
Not specified
Tags:
sqlite drop oneliner
Score:
0 (after 0 ratings)

I use this oneliner to delete the matching tables in SQLite. Use carefully!

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

Comments

Please login first before commenting.