-
-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin integration is broken when using ORM as a broker with a different database #472
Comments
Good spot. Seems like an easy enough fix. |
Now that I look at the code a little bit more - I see that the QueueAdmin is really only in case you are using the ORM as a broker. |
No, I didn't run migrations on my default database why should I do so if I'm using a separate DB for django_q? I ran migrations on the other DB as docs pointed out:
|
I have been thinking about this for the past hour and I still can't find any reasonable reason why migrations should be run twice on two databases, I understand it may be a design thing for admin integration for other brokers but in practice, it should be all in one place in this case. |
@Koed00 some clarification would be much appreciated, I really need to understand why migrations should be applied to two databases |
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 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. |
this is unintuitive. I also discovered this also holds true when using redis as a broker? at least according to 'manage.py migrate' which modifies my main db |
Hello,
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 underDJANGO_Q
section except forQueued 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 withQueueAdmin
and others are not at all, I have even tried to add using() forTaskAdmin
and it worked as expected, so it is all about that.I'm using Django 2.2.16 and PostgreSQL 12.3
The text was updated successfully, but these errors were encountered: