ಪರಿಹರಿಸಲಾಗಿದೆ: ಜಾಂಗೊ ಡಂಪ್ ಹಿಂದಿನ ವಲಸೆಗಳು

ಮುಖ್ಯ ಸಮಸ್ಯೆ ಏನೆಂದರೆ, ನೀವು ವಲಸೆಯನ್ನು ಬಿಟ್ಟು ನಂತರ ಮತ್ತೆ ವಲಸೆಗಳನ್ನು ಚಲಾಯಿಸಲು ಪ್ರಯತ್ನಿಸಿದರೆ, ಜಾಂಗೊ ನೀವು ಮಾಡಿದ ಬದಲಾವಣೆಗಳನ್ನು ಗುರುತಿಸುವುದಿಲ್ಲ ಮತ್ತು ಬದಲಿಗೆ ಮೂಲ ವಲಸೆಯನ್ನು ಮರು-ರನ್ ಮಾಡುತ್ತದೆ.

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 &gt; 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 &gt; app/fixtures/initial_data.json  # add all your apps here separated by spaces 
</code>

ಡಂಪ್ ಎಂದರೇನು

ಡಂಪ್ ಎನ್ನುವುದು ಡೇಟಾಬೇಸ್‌ನ ವಿಷಯಗಳನ್ನು ಪಠ್ಯ ಫೈಲ್‌ಗೆ ಡಂಪ್ ಮಾಡಲು ಆಜ್ಞಾ ಸಾಲಿನ ಸಾಧನವಾಗಿದೆ.

ಜಾಂಗೊದಲ್ಲಿ ವಲಸೆಯನ್ನು ಮಾಡಲು ವಾಟ್

1.8

ಜಾಂಗೊ 1.8 ರಲ್ಲಿ ನಿಮ್ಮ ಡೇಟಾವನ್ನು ಸ್ಥಳಾಂತರಿಸಲು ಕೆಲವು ವಿಭಿನ್ನ ಮಾರ್ಗಗಳಿವೆ.

1. ನಿಮ್ಮ ಅಭಿವೃದ್ಧಿ ಸರ್ವರ್‌ನಲ್ಲಿ ವಲಸೆಗಳ ಸರಣಿಯನ್ನು ಚಲಾಯಿಸಲು ಮೈಗ್ರೇಟ್ ಆಜ್ಞೆಯನ್ನು ಬಳಸಿ:

$ python manage.py ವಲಸೆ

2. ಜಾಂಗೊ-ಮೈಗ್ರೇಟ್ ಉಪಕರಣವನ್ನು ಬಳಸಿ:

$ ಪಿಪ್ ಇನ್‌ಸ್ಟಾಲ್ ಜಾಂಗೊ-ಮೈಗ್ರೇಟ್ $ ಸಿಡಿ ನನ್ನ ಪ್ರಾಜೆಕ್ಟ್ $ ಜಾಂಗೊ-ಮೈಗ್ರೇಟ್ ಇನ್‌ಇಟ್ $ ಪೈಥಾನ್ ಮ್ಯಾನೇಜ್.ಪಿ ಮೈಗ್ರೇಟ್

ಸಂಬಂಧಿತ ಪೋಸ್ಟ್ಗಳು:

ಒಂದು ಕಮೆಂಟನ್ನು ಬಿಡಿ