migrate_schemas not running
See original GitHub issueUsing in requirements.txt
Django==3.1
django-tenant-schemas==1.10.0
In settings.py
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (1 by maintainers)
Top Results From Across the Web
app.migrateSchema is not a function · Issue #4002 - GitHub
btw: the run migrate iterations I've been through shows the script trying to alter schema for the target mongodb - does this even...
Read more >Migrate Schemas - Confluent Documentation
Migrate Schemas ¶ · Start the origin cluster. · Verify that schema-registry , kafka , and zookeeper are running. · Verify that no...
Read more >python - django-tenant-schemas wont apply migration to ...
You are running manage.py migrate_schemas --shared. Which migrates only public schema. You should run manage.py migrate_schemas.
Read more >Working with Preference File (JSON) for Post-migration
When you want to update the schema and use the feature of preferences, then a migrateSchema.json file would need to be created in...
Read more >Executor.hpp - Oat++
Execute database query using a query template. ... Should NOT be used directly. ... void, migrateSchema, Run schema migration script. Should NOT be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I discovered the reason for the problem. This error occurs in versions of Django greater than 3.0.9. So, I downgraded from version 3.1 to version 3.0.9
Hi guys, I am having the same problem too using
Django 3.1
andDTS 1.10.0
.I looked around and realized that it has something to do with the changes in Django related to the
skip_checks
command option.First, in https://github.com/django/django/commit/6866c91b638de5368c18713fa851bfe56253ea55
--skip-check
was introduced inDjango BaseCommand
causing the argument to be added twice sincemigrate
adds it too. So to prevent the issue,requires_system_checks
has to be set toFalse
Now, https://code.djangoproject.com/ticket/31546 and https://github.com/django/django/pull/12910 introduced the notion of specific system checks. So
requires_system_checks = []
is the new way of setting it to falseThat said, here are different solutions/workarounds I found
1 - Add
requires_system_checks = []
tomigrate_schemas
command class2 - Or customize
BaseCommand.create_parser(prog_name, subcommand, **kwargs)
to tell arg parser not to raise an exception when an argument is defined twice. (https://docs.python.org/3/library/argparse.html#conflict-handler)I am more inclined to go with solution 1, I will make a PR with that. Please let me know what you think or if there is an even better way to approach it, I wouldn’t say I have a complete picture this is the first time I am using DTS.
In the meantime, you can locally override the
migrate_schemas
command to add the fix locally following https://docs.djangoproject.com/en/3.0/howto/custom-management-commands/