📜  如何从 sqlite 迁移到 postgresql django - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:56.170000             🧑  作者: Mango

代码示例1
# when using sqlite3
python manage.py dumpdata > datadump.json
# after chagne db
python manage.py makemigrations
python manage.py migrate --run-syncdb
python manage.py shell
from django.contrib.contenttypes.models import ContentType
ContentType.objects.all().delete()
quit()
python manage.py loaddata datadump.json