Don't run makemigrations until set up is done (#459)
This commit is contained in:
parent
cf154c6463
commit
4131b5f3ff
|
@ -56,8 +56,6 @@ If you'd like to serve the public tenant for unrecognised hostnames instead, use
|
|||
#...
|
||||
)
|
||||
|
||||
Make sure you have ``django.template.context_processors.request`` listed under ``context_processors`` (Django 1.8+):
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
TEMPLATES = [
|
||||
|
@ -102,11 +100,7 @@ Now we have to create your tenant model. Your tenant model can contain whichever
|
|||
# default true, schema will be automatically created and synced when it is saved
|
||||
auto_create_schema = True
|
||||
|
||||
Once you have defined your model, don't forget to create the migrations for it or otherwise Django >= 1.9 will not create its table. Replace ``customers`` with your app name.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python manage.py makemigrations customers
|
||||
Before creating the migrations, we must configure a few specific settings.
|
||||
|
||||
Configure Tenant and Shared Applications
|
||||
========================================
|
||||
|
@ -156,7 +150,13 @@ You also have to set where your tenant model is.
|
|||
|
||||
TENANT_MODEL = "customers.Client" # app.Model
|
||||
|
||||
Now run ``migrate_schemas --shared`` to create the shared apps on the ``public`` schema. Note: your database should be empty if this is the first time you're running this command.
|
||||
Now you must create your app migrations for ``customers``:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python manage.py makemigrations customers
|
||||
|
||||
The command ``migrate_schemas --shared`` will create the shared apps on the ``public`` schema. Note: your database should be empty if this is the first time you're running this command.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
|
Loading…
Reference in New Issue