File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,22 @@ Spanner has some limitations on schema changes which you must respect:
150
150
* A table's primary key can't be altered.
151
151
* Migrations aren't atomic since django-spanner doesn't support transactions.
152
152
153
+ ### ` DurationField ` arithmetic doesn't work with ` DateField ` values
154
+
155
+ Spanner requires using different functions for arithmetic depending on the
156
+ column type:
157
+
158
+ * ` TIMESTAMP ` columns (` DateTimeField ` ) require ` TIMESTAMP_ADD ` or
159
+ ` TIMESTAMP_SUB `
160
+ * ` DATE ` columns (` DateField ` ) require ` DATE_ADD ` or ` DATE_SUB `
161
+
162
+ Django doesn't provide a way to determine which database function to use.
163
+ ` DatabaseOperations.combine_duration_expression() ` arbitrary uses
164
+ ` TIMESTAMP_ADD ` and ` TIMESTAMP_SUB ` . Therefore, if you use a ` DateField ` in a
165
+ ` DurationField ` expression, you'll see an error like: "No matching signature
166
+ for function TIMESTAMP_SUB for argument types: DATE, INTERVAL INT64
167
+ DATE_TIME_PART."
168
+
153
169
### Computations that yield FLOAT64 values can't be assigned to INT64 columns
154
170
155
171
Spanner [ doesn't support this] ( https://github.com/googleapis/python-spanner-django/issues/331 ) .
You can’t perform that action at this time.
0 commit comments