You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Change AutoFiled and SmallAutoField to clickhouse Int64, so that id worker can generate value for them.
* `DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'` is no longer a required configuration item.
- In outer join, clickhouse will set missing columns to empty values (0 for number, empty string for text, unix epoch for date/datatime) instead of NULL.
29
29
So Count("book") resolve to 1 in a missing LEFT OUTER JOIN match, not 0.
30
30
In aggregation expression Avg("book__rating", default=2.5), default=2.5 have no effect in a missing match.
31
+
- Clickhouse does not support unique constraint and foreignkey constraint. `ForeignKey`, `ManyToManyField` and `OneToOneField` can be used with clickhouse backend, but no database level constraints will be added, so there could be some consistency problems.
32
+
- Clickhouse does not support transaction. If any exception occurs during migrating, then your clickhouse database will be in an untracked state. Any migration should be full tested in test environment before deployed to production environment.
@@ -143,8 +141,6 @@ automatically route your queries to the right database. In the preceding example
143
141
queries from subclasses of `clickhouse_backend.models.ClickhouseModel` or custom migrations with a `clickhouse` hint key to clickhouse.
144
142
All other queries are routed to the default database (postgresql).
145
143
146
-
`DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'` is required to working with django migration.
147
-
More details will be covered in [DEFAULT_AUTO_FIELD](https://github.com/jayvynl/django-clickhouse-backend/blob/main/docs/Configurations.md#default_auto_field).
148
144
149
145
### Model Definition
150
146
@@ -224,7 +220,7 @@ this operation will generate migration file under apps/migrations/
224
220
then we mirgrate
225
221
226
222
```shell
227
-
$ python manage.py migrate
223
+
$ python manage.py migrate --database clickhouse
228
224
```
229
225
230
226
for the first time run, this operation will generate django_migrations table with create table sql like this
0 commit comments