Revert database scheme based on django migrations

64 views
Skip to first unread message

Luis Zárate

unread,
Sep 11, 2017, 7:11:54 PM9/11/17
to django...@googlegroups.com, Marta
Hello people,

I really would like you to help me with some thing I need to solve. 

I have an app that do automated deployment of django apps, that also can update existing deployments. So I need to revert my database to last state if something went wrong.

So, my question is, how can I revert all the migrations that were applied after run the migrate command?
It can have more than one migration and in different apps, so how can I know where to go back and how to leave the database in the previous state without having to do a backup of database and a restore? (some databases can have a lot of registers).  How can I make a restore point of my migrations or indicate django to go back in my database scheme?

Thanks in advance for the help you can provide me.

--
"La utopía sirve para caminar" Fernando Birri


Alessandro Madruga Correia

unread,
Sep 12, 2017, 8:27:13 AM9/12/17
to django...@googlegroups.com
Hi there

To go to a specific migration just run

$ python manage.py migrate <app> <migration point>

About your data I think is better you make backup. 



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAG%2B5VyN2r8w_h0iXouY5PnCdxTBqx7eNv6D8r95nB8QVnHH1cQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages