citusdata / django-multitenant

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

Adds readthedocs documents and integration #148

Closed gurkanindibay closed 1 year ago

gurkanindibay commented 1 year ago

Adds Read The Docs integration https://django-multitenant.readthedocs.io/en/latest/index.html You can check the structure and please add your comments to finalize the document

codecov[bot] commented 1 year ago

Codecov Report

Merging #148 (7833d77) into main (d57f86f) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #148   +/-   ##
=======================================
  Coverage   98.01%   98.01%           
=======================================
  Files          32       32           
  Lines        1006     1006           
=======================================
  Hits          986      986           
  Misses         20       20           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

gurkanindibay commented 1 year ago

For a first round of review, can you please fix the sphinx warnings?

$ make html
Running Sphinx v5.3.0
loading translations [python]... not available for built-in messages
making output directory... done
WARNING: html_static_path entry '_static' does not exist
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 5 source files that are out of date
updating environment: [new config] 5 added, 0 changed, 0 removed
reading sources... [100%] usage
/Users/jonels/dev/django-multitenant/docs/source/general.rst:9: WARNING: Title underline too short.

Supported Django and Citus versions/Pre-requisites
=================================
/Users/jonels/dev/django-multitenant/docs/source/general.rst:9: WARNING: Title underline too short.

Supported Django and Citus versions/Pre-requisites
=================================
/Users/jonels/dev/django-multitenant/docs/source/migration_mt_django.rst:5: WARNING: Title underline too short.

Migrating a multi-tenant Django application to Citus
=================================
/Users/jonels/dev/django-multitenant/docs/source/migration_mt_django.rst:108: WARNING: Title underline too short.

**1.2. Introduce a column for the account\_id on every ManyToMany model that belongs to an account**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jonels/dev/django-multitenant/docs/source/migration_mt_django.rst:108: WARNING: Title underline too short.

**1.2. Introduce a column for the account\_id on every ManyToMany model that belongs to an account**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jonels/dev/django-multitenant/docs/source/migration_mt_django.rst:220: WARNING: Title underline too short.

**2.2 Including the account\_id to unique constraints**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jonels/dev/django-multitenant/docs/source/migration_mt_django.rst:220: WARNING: Title underline too short.

**2.2 Including the account\_id to unique constraints**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jonels/dev/django-multitenant/docs/source/migration_mt_django.rst:323: WARNING: Title underline too short.

3. Updating the models to use TenantModelMixin and TenantForeignKey
------------------------------------------------------------------
/Users/jonels/dev/django-multitenant/docs/source/migration_mt_django.rst:323: WARNING: Title underline too short.

3. Updating the models to use TenantModelMixin and TenantForeignKey
------------------------------------------------------------------
/Users/jonels/dev/django-multitenant/docs/source/migration_mt_django.rst:342: WARNING: Title underline too short.

**3.1 Introducing the TenantModelMixin and TenantManager**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] usage
/Users/jonels/dev/django-multitenant/docs/source/migration_mt_django.rst:7: WARNING: undefined label: 'mt_schema_migration'
generating indices... genindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 12 warnings.

The HTML pages are in build/html.

The part about mt_schema_migration is something to think about because the section refers to external docs pages from where it was copied.

Fixed all the warnings

gurkanindibay commented 1 year ago

Small change request.

Once that's fixed, and once you've tested that the migration docs are up to date with the latest version of the library, then I think it'll be good to merge.

My suggestion is merging this PR and after merging all PR's and update the document it's better for me to test with the latest version.

gurkanindibay commented 1 year ago

Sounds good.

How about we merge this one and rebase others on it if they require docs changes, and make/test the changes in the other PRs.

It sounds good