Closed The-Daishogun closed 3 years ago
Hi.
Is your Django app added to INSTALLED_APPS setting? Migrations are triggerred by post_migrate django signal for each installed app. You can see code here. When migration is applied during manage.py migrate
call, you should see this message in output. If not, it means one of the following:
CLICKHOUSE_MIGRATE_WITH_DEFAULT_DB
setting is set to Falseyour_app.clickhouse_migrations
package can not be importedThank you for you quick response. the app is registered in INSTALLED_APPS since the sql migrations get applied. i also set the CLICKHOUSE_MIGRATE_WITH_DEFAULT_DB to True in settings.py and added migrate=True to the clickhouse database configurations but it didn't help.
i forced the migrations using
# manual migrations
import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "podafarini.settings")
django.setup()
from django_clickhouse.migrations import migrate_app, clickhouse_migrate
migrate_app("stats", "default")
it worked fine. and i received the aforementioned message. but no luck with applying them automatically
Is django_clickhouse added to installed apps? You may also try calling some simple print statement on post_migrate in order to check if signal is called for default db and your app
Tdding django_clickhouse to installed apps was the solution. Thank you very much.
This should be added to docs. I'll do it a little bit later.
I thought i'd missed something when i read the docs. thank you so much.
Released
Hello I am building a django backend which uses clickhouse to keep track of the number of clicks or downloads from a url. i've gone through the docs step by step to get it to work but unfortunately, even though the sql migrations are applied, click house migrations don't seem to do anything. and i don't get any errors which makes it very hard to track down the problem. here are my codes:
thank you in advance.