File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,28 @@ configured:
140
140
}
141
141
}
142
142
143
+ Configuring primary key generation
144
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
145
+
146
+ The Spanner Django engine by default uses random int64 values that are generated
147
+ by the client as primary key values. This default is applied to all databases that are
148
+ configured, including databases that use a different engine than Spanner. You can
149
+ disable this behavior with the RANDOM_ID_GENERATION_ENABLED setting:
150
+
151
+ .. code :: python
152
+
153
+ DATABASES = {
154
+ ' default' : {
155
+ ' ENGINE' : ' django_spanner' ,
156
+ ' PROJECT' : ' $PROJECT' ,
157
+ ' INSTANCE' : ' $INSTANCE' ,
158
+ ' NAME' : ' $DATABASE' ,
159
+ ' RANDOM_ID_GENERATION_ENABLED' : false,
160
+ }
161
+ }
162
+
163
+
164
+
143
165
Transaction support in autocommit mode
144
166
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
145
167
You can’t perform that action at this time.
0 commit comments