Fixed #34851 -- Dropped support for PostgreSQL 12 and PostGIS 2.5.

This commit is contained in:
Mariusz Felisiak 2023-09-20 13:45:51 +02:00 committed by GitHub
parent 0b506bfe1a
commit 2c6ebb65c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 32 additions and 47 deletions

View file

@ -1,6 +1,6 @@
from unittest import mock
from django.db import connection, migrations
from django.db import migrations
try:
from django.contrib.postgres.operations import (
@ -9,7 +9,6 @@ try:
BtreeGistExtension,
CITextExtension,
CreateExtension,
CryptoExtension,
HStoreExtension,
TrigramExtension,
UnaccentExtension,
@ -23,11 +22,6 @@ except ImportError:
HStoreExtension = mock.Mock()
TrigramExtension = mock.Mock()
UnaccentExtension = mock.Mock()
needs_crypto_extension = False
else:
needs_crypto_extension = (
connection.vendor == "postgresql" and not connection.features.is_postgresql_13
)
class Migration(migrations.Migration):
@ -39,8 +33,6 @@ class Migration(migrations.Migration):
# Ensure CreateExtension quotes extension names by creating one with a
# dash in its name.
CreateExtension("uuid-ossp"),
# CryptoExtension is required for RandomUUID() on PostgreSQL < 13.
CryptoExtension() if needs_crypto_extension else mock.Mock(),
HStoreExtension(),
TrigramExtension(),
UnaccentExtension(),