- Author:
- mpasternacki
- Posted:
- January 28, 2010
- Language:
- SQL
- Version:
- Not specified
- Score:
- 1 (after 1 ratings)
Drops all tables in MySQL table (either managed by Django or not). Useful when resetting the database with no CREATE DATABASE privileges. MySQL-only.
1 2 3 4 5 | echo 'show tables;' \
| python manage.py dbshell \
| sed -n 2,\$p \
| awk 'BEGIN {print "set foreign_key_checks=0;"} { print "drop table `" $1 "`;"}' \
| python manage.py dbshell
|
More like this
- create_template_postgis-ubuntu_lucid by clawlor 14 years, 2 months ago
- PostgreSQL fulltext with language translations by diverman 14 years, 3 months ago
- grep and delete sqlite tables by kifkif 14 years, 11 months ago
- Substitute hyphens with spaces to enale URLs to reference to multi-word tags by miernik 15 years ago
- oneliner to delete SQLite tables by kifkif 15 years ago
Comments
Please login first before commenting.