প্রধান সমস্যা হল যে আপনি যদি একটি মাইগ্রেশন ডাম্প করেন এবং তারপরে আবার মাইগ্রেশন চালানোর চেষ্টা করেন, জ্যাঙ্গো আপনার করা পরিবর্তনগুলি চিনতে পারবে না এবং পরিবর্তে মূল মাইগ্রেশনটি পুনরায় চালাবে।
I am trying to dump my previous migrations in Django. I have tried the following command: <code>python manage.py dumpdata --exclude contenttypes --exclude auth.permission > app/fixtures/initial_data.json</code> However, this only dumps my current data and not the data from my previous migrations. How can I do this? A: You can use <code>--format=json</code> to export your data into a json file and then you can use it as a fixture for your future migrations: <code>python manage.py dumpdata --format=json --indent=4 > app/fixtures/initial_data.json # add all your apps here separated by spaces </code>
ডাম্প কি
ডাম্প একটি টেক্সট ফাইলে ডাটাবেসের বিষয়বস্তু ডাম্প করার জন্য একটি কমান্ড লাইন টুল।
জ্যাঙ্গোতে মাইগ্রেশন করতে ওয়াট
1.8
Django 1.8 এ আপনার ডেটা স্থানান্তর করার কয়েকটি ভিন্ন উপায় রয়েছে।
1. আপনার ডেভেলপমেন্ট সার্ভারে একাধিক মাইগ্রেশন চালানোর জন্য মাইগ্রেট কমান্ডটি ব্যবহার করুন:
$ python management.py মাইগ্রেট
2. জ্যাঙ্গো-মাইগ্রেট টুল ব্যবহার করুন:
$pip ইনস্টল করুন django-migrate $cd myproject $django-migrate init $python management.py মাইগ্রেট