开发者

Django South: How to use with multiple installs of codebase and one central database?

开发者 https://www.devze.com 2023-02-14 22:49 出处:网络
I am converting an existing codebase (with several apps) to use South. My codebase is currently installed on 1 development server and 3 production servers. The development has its own database and the

I am converting an existing codebase (with several apps) to use South. My codebase is currently installed on 1 development server and 3 production servers. The development has its own database and the 3 production servers are all connected to one central database.

I read the info at http://south.aeracode.org/docs/convertinganapp.html but I am still a bit confused as to how to proceed.

This is the steps I plan to follow:

Dev Server: ./manage.py syncdb (To create South tables in dev db)

Dev Server: ./manage.py convert_to_south myapp (To create South files & records in the dev db)

Dev Server: push to VCS

Server 1: pull from VCS (To get South files)

Server 1: ./manage.py syncdb (To create South tables in production db)

Server 1: ./manage.py migrate myapp 0001 --fake (To create South records in the production db)

Server 2: pull from VCS (To get South files)

Server 2: ./manage.py migrate myapp 0001 --fake

Server 3: pull from VCS (To get South files)

Server 3: ./manage.py migrate myapp 0001 --fake

Repeat these steps for all apps.

Question 1:

Is the ./manage.py migrate myapp 0001 --fake step required on Servers 2 and 3? Since I will be running the migrations on Server 1 and all three servers are using the same database, it seems like it should not be required but I am not 100% sure.

Question开发者_高级运维 2:

If ./manage.py migrate myapp 0001 --fake is required on Servers 2 and 3, will I need to run the command on Servers 2 and 3 every time I do a database migration?

As always, thanks so much for your help.


No, You use it only to apply changes to the database schema. You don't need to run migrate again on Servers 2 and 3, since they are using the same db as Server 1.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号