mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #31196 -- Installed postgis_raster extension on PostGIS 3+.
This commit is contained in:
committed by
Mariusz Felisiak
parent
cc70a0343e
commit
a6b4c07b6e
@@ -0,0 +1,18 @@
|
||||
from django.db import connection, migrations
|
||||
|
||||
if connection.features.supports_raster:
|
||||
from django.contrib.postgres.operations import CreateExtension
|
||||
|
||||
pg_version = connection.ops.postgis_version_tuple()
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
# PostGIS 3+ requires postgis_raster extension.
|
||||
if pg_version[1:] >= (3,):
|
||||
operations = [
|
||||
CreateExtension('postgis_raster'),
|
||||
]
|
||||
else:
|
||||
operations = []
|
||||
else:
|
||||
class Migration(migrations.Migration):
|
||||
operations = []
|
||||
Reference in New Issue
Block a user