mirror of https://github.com/django/django.git
Fixed testing on SpatiaLite 2.4, which has support for `InitSpatialMetaData`.
This commit is contained in:
parent
5d4f993bb1
commit
1c3464e809
|
@ -99,14 +99,14 @@ class SpatiaLiteCreation(DatabaseCreation):
|
||||||
"""
|
"""
|
||||||
This routine loads up the SpatiaLite SQL file.
|
This routine loads up the SpatiaLite SQL file.
|
||||||
"""
|
"""
|
||||||
if self.connection.ops.spatial_version[:2] >= (3, 0):
|
if self.connection.ops.spatial_version[:2] >= (2, 4):
|
||||||
# Spatialite >= 3.0.x -- No need to load any SQL file, calling
|
# Spatialite >= 2.4 -- No need to load any SQL file, calling
|
||||||
# InitSpatialMetaData() transparently creates the spatial metadata
|
# InitSpatialMetaData() transparently creates the spatial metadata
|
||||||
# tables
|
# tables
|
||||||
cur = self.connection._cursor()
|
cur = self.connection._cursor()
|
||||||
cur.execute("SELECT InitSpatialMetaData()")
|
cur.execute("SELECT InitSpatialMetaData()")
|
||||||
else:
|
else:
|
||||||
# Spatialite < 3.0.x -- Load the initial SQL
|
# Spatialite < 2.4 -- Load the initial SQL
|
||||||
|
|
||||||
# Getting the location of the SpatiaLite SQL file, and confirming
|
# Getting the location of the SpatiaLite SQL file, and confirming
|
||||||
# it exists.
|
# it exists.
|
||||||
|
|
Loading…
Reference in New Issue