【发布时间】:2012-09-05 06:40:15
【问题描述】:
我在 PostgreSql 中有一个名为“tests”的数据库。 我想用 django 编写 sh 脚本来同步它,运行测试然后删除所有表。 任何人都可以提出适当的解决方案吗? 一点脚本:
DJANGO_DATABASE='tests' bin/django-admin.py syncdb
bin/django-admin.py test MyApplication #tests will use "tests" db
sudo su postgres
psql tests
drop schema public; #i think i can drop schema and then syncdb.. or i'm wrong.
exit
【问题讨论】:
标签: django postgresql sh postgresql-9.1