开发者

Refactoring models from one django app into two

开发者 https://www.devze.com 2023-01-24 03:58 出处:网络
I\'ve got an app which has grown too big and I\'d like to split it into two. It\'s not an easy task code-wise, but I\'m more afraid of the database migrations I\'ll have to perform. Is there a proven

I've got an app which has grown too big and I'd like to split it into two. It's not an easy task code-wise, but I'm more afraid of the database migrations I'll have to perform. Is there a proven way of doing such kind of thing?

Currently my thoughts are something like this:

  • Use south
  • Copy models to another app
  • Make a data migration to copy relevant models from one app to the other
  • Make another migration that removes the now unused models from the old 开发者_运维百科app
  • Will have to make a script that does those operations in correct order

Has anybody done anything like this?


No need to do any database migrations if you don't want to. Just set the db_table Meta attribute on your models to refer to the old names, and everything will be perfectly happy.

0

精彩评论

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