citusdata / django-multitenant

Python/Django support for distributed multi-tenant databases like Postgres+Citus
MIT License
731 stars 118 forks source link

Update django-multitenant to support Citus and automatic Django migrations #53

Closed ledburyb closed 5 years ago

ledburyb commented 5 years ago

Opening this up largely for discussion, it's not yet merge-ready. The issues that me and my team have been having is that while this library is a good first-step towards moving to Citus it isn't currently complete enough to use comfortably for day-to-day development.

Our changes include:

  1. Automatic creation of a composite primary keys in migrations.
  2. Making sure migrations are fully forwards and backwards compatible.
  3. Automatically running the right Citus commands when creating tables.
  4. Full compatibility with the Django test framework when running tests against a Citus cluster (Locally running one in Docker).

Perhaps some of these things are beyond the scope of this library, others may just need to be turned on or off by settings flags, but I think what we're really wanting is a something that makes it as straightforward as possible to use Citus and Django together not just as an initial migration but on a living project where models are continually added and schemas altered.

citus-bot commented 5 years ago

Hi @ledburyb, thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement.

saicitus commented 5 years ago

This is awesome! 💯 👏 Thanks for the contribution @ledburyb. We will soon review and try to merge it :)

citus-bot commented 4 years ago

You did it @ledburyb!

Thank you for signing the Citus Data Contributor License Agreement. We can now accept this contribution and all future contributions from you.

Somebody from our team will proceed with code review.