Admin integration is broken when using ORM as a broker with a different database
See original GitHub issueHello,
I’m using ORM as a broker and I have exactly followed the same steps mentioned at the docs regarding using a separate DB for django_q and applying migrations.
However, when browsing admin dashboard I always get relation "django_q_schedule" does not exist
when trying to open anything under DJANGO_Q
section except for Queued tasks
, this was clearly about that it doesn’t use the correct DB, so I looked at admin.py and my guess was right, using()
connection is only respected with QueueAdmin
and others are not at all, I have even tried to add using() for TaskAdmin
and it worked as expected, so it is all about that.
I’m using Django 2.2.16 and PostgreSQL 12.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Django Q Documentation
Failure and success database or cache. • Result hooks, groups and chains. • Django Admin integration. • PaaS compatible with multiple ...
Read more >Troubleshoot SQL Server Service Broker issues - Operations ...
In SQL Server Management Studio, go to Databases > OperationsManager > Service Broker. Expand Queues and Services. Verify that there's a queue ...
Read more >Who's Really Doing Continuous Integration of SQL Server ...
What benefits have you achieved by using CI? (New) Is the application deployed in only one database, or across many nearly-identical copies of ......
Read more >Queues against Tables in messaging systems - Stack Overflow
Similarly - you'd never use a database to do load balancing of HTTP ... Tables are accessed through this peculiar "other language" (SQL), ......
Read more >Developers and Identity Services - Oracle
manageable for enterprise users from IT administrators to business users. ... from other role provider can also be leveraged through integration.
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 Free
Top 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
Hello! Sorry for resurrecting this old thread since I just encountered the same issue as the original poster. So if my understanding is correct, when using another database as a broker, all task-related data except
Queued tasks
are still saved on the default database. Therefore, 2 migrations need to be run. The first migration is to havedjango_q_schedule
anddjango_q_task
on your default DB, while the second would be fordjango_q_ormq
on your broker database.I think this was designed such that even when changing brokers, the task data would remain intact on only one database. Think of a scenario wherein you started using another DB as a broker but then switched to Redis. This would result in you still keeping the separate broker database even though it outlived its main purpose already.
Good spot. Seems like an easy enough fix.