1
0
mirror of https://github.com/django/django.git synced 2024-12-23 17:46:27 +00:00
django/tests/gis_tests/rasterapp/migrations/0001_setup_extensions.py
2022-02-07 20:37:05 +01:00

21 lines
554 B
Python

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 = []