mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Fixed #27996 -- Added RandomUUID function and CryptoExtension to contrib.postgres.
This commit is contained in:
parent
98ee57e343
commit
fcb5dbfec0
9 changed files with 81 additions and 5 deletions
|
@ -4,13 +4,14 @@ from django.db import migrations
|
|||
|
||||
try:
|
||||
from django.contrib.postgres.operations import (
|
||||
BtreeGinExtension, CITextExtension, CreateExtension, HStoreExtension,
|
||||
TrigramExtension, UnaccentExtension,
|
||||
BtreeGinExtension, CITextExtension, CreateExtension, CryptoExtension,
|
||||
HStoreExtension, TrigramExtension, UnaccentExtension,
|
||||
)
|
||||
except ImportError:
|
||||
BtreeGinExtension = mock.Mock()
|
||||
CITextExtension = mock.Mock()
|
||||
CreateExtension = mock.Mock()
|
||||
CryptoExtension = mock.Mock()
|
||||
HStoreExtension = mock.Mock()
|
||||
TrigramExtension = mock.Mock()
|
||||
UnaccentExtension = mock.Mock()
|
||||
|
@ -24,6 +25,7 @@ class Migration(migrations.Migration):
|
|||
# Ensure CreateExtension quotes extension names by creating one with a
|
||||
# dash in its name.
|
||||
CreateExtension('uuid-ossp'),
|
||||
CryptoExtension(),
|
||||
HStoreExtension(),
|
||||
TrigramExtension(),
|
||||
UnaccentExtension(),
|
||||
|
|
|
@ -191,6 +191,13 @@ class Migration(migrations.Migration):
|
|||
('when', models.DateTimeField(null=True, default=None)),
|
||||
]
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='UUIDTestModel',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('uuid', models.UUIDField(default=None, null=True)),
|
||||
]
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='RangesModel',
|
||||
fields=[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue