2020-04-10 20:30:25 +00:00
|
|
|
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 = []
|
2022-02-03 19:24:19 +00:00
|
|
|
|
2020-04-10 20:30:25 +00:00
|
|
|
else:
|
2022-02-03 19:24:19 +00:00
|
|
|
|
2020-04-10 20:30:25 +00:00
|
|
|
class Migration(migrations.Migration):
|
|
|
|
operations = []
|