2016-08-11 19:05:52 +00:00
|
|
|
from django.core.serializers.json import DjangoJSONEncoder
|
2015-01-28 12:35:27 +00:00
|
|
|
from django.db import migrations, models
|
2014-03-14 17:34:49 +00:00
|
|
|
|
2016-06-16 13:07:51 +00:00
|
|
|
from ..fields import (
|
2017-02-11 12:16:35 +00:00
|
|
|
ArrayField, BigIntegerRangeField, CICharField, CIEmailField, CITextField,
|
2018-10-02 23:17:23 +00:00
|
|
|
DateRangeField, DateTimeRangeField, DecimalRangeField, HStoreField,
|
2017-02-11 12:16:35 +00:00
|
|
|
IntegerRangeField, JSONField, SearchVectorField,
|
2016-06-16 13:07:51 +00:00
|
|
|
)
|
2015-07-22 17:51:05 +00:00
|
|
|
from ..models import TagField
|
2015-04-04 16:10:26 +00:00
|
|
|
|
2014-03-14 17:34:49 +00:00
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
('postgres_tests', '0001_setup_extensions'),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='CharArrayModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2015-04-04 16:10:26 +00:00
|
|
|
('field', ArrayField(models.CharField(max_length=10), size=None)),
|
2014-03-14 17:34:49 +00:00
|
|
|
],
|
|
|
|
options={
|
2015-04-04 16:10:26 +00:00
|
|
|
'required_db_vendor': 'postgresql',
|
2014-03-14 17:34:49 +00:00
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='DateTimeArrayModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2015-04-04 16:10:26 +00:00
|
|
|
('datetimes', ArrayField(models.DateTimeField(), size=None)),
|
|
|
|
('dates', ArrayField(models.DateField(), size=None)),
|
|
|
|
('times', ArrayField(models.TimeField(), size=None)),
|
2014-03-14 17:34:49 +00:00
|
|
|
],
|
|
|
|
options={
|
2015-04-04 16:10:26 +00:00
|
|
|
'required_db_vendor': 'postgresql',
|
2014-03-14 17:34:49 +00:00
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='HStoreModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2015-04-04 16:10:26 +00:00
|
|
|
('field', HStoreField(blank=True, null=True)),
|
2017-05-03 04:24:54 +00:00
|
|
|
('array_field', ArrayField(HStoreField(), null=True)),
|
2014-03-14 17:34:49 +00:00
|
|
|
],
|
|
|
|
options={
|
2015-04-04 16:10:26 +00:00
|
|
|
'required_db_vendor': 'postgresql',
|
2014-03-14 17:34:49 +00:00
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
2015-01-10 18:13:28 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='OtherTypesArrayModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2018-09-18 20:14:44 +00:00
|
|
|
('ips', ArrayField(models.GenericIPAddressField(), size=None, default=list)),
|
|
|
|
('uuids', ArrayField(models.UUIDField(), size=None, default=list)),
|
|
|
|
('decimals', ArrayField(models.DecimalField(max_digits=5, decimal_places=2), size=None, default=list)),
|
2015-07-22 17:51:05 +00:00
|
|
|
('tags', ArrayField(TagField(), blank=True, null=True, size=None)),
|
2018-07-27 15:35:54 +00:00
|
|
|
('json', ArrayField(JSONField(default={}), default=[])),
|
|
|
|
('int_ranges', ArrayField(IntegerRangeField(), null=True, blank=True)),
|
|
|
|
('bigint_ranges', ArrayField(BigIntegerRangeField(), null=True, blank=True)),
|
2015-01-10 18:13:28 +00:00
|
|
|
],
|
|
|
|
options={
|
2015-04-04 16:10:26 +00:00
|
|
|
'required_db_vendor': 'postgresql',
|
2015-01-10 18:13:28 +00:00
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
2014-03-14 17:34:49 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='IntegerArrayModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2015-04-04 16:10:26 +00:00
|
|
|
('field', ArrayField(models.IntegerField(), size=None)),
|
2014-03-14 17:34:49 +00:00
|
|
|
],
|
|
|
|
options={
|
2015-04-04 16:10:26 +00:00
|
|
|
'required_db_vendor': 'postgresql',
|
2014-03-14 17:34:49 +00:00
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='NestedIntegerArrayModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2015-04-04 16:10:26 +00:00
|
|
|
('field', ArrayField(ArrayField(models.IntegerField(), size=None), size=None)),
|
2014-03-14 17:34:49 +00:00
|
|
|
],
|
|
|
|
options={
|
2015-04-04 16:10:26 +00:00
|
|
|
'required_db_vendor': 'postgresql',
|
2014-03-14 17:34:49 +00:00
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='NullableIntegerArrayModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2015-04-04 16:10:26 +00:00
|
|
|
('field', ArrayField(models.IntegerField(), size=None, null=True, blank=True)),
|
2014-03-14 17:34:49 +00:00
|
|
|
],
|
|
|
|
options={
|
2015-04-04 16:10:26 +00:00
|
|
|
'required_db_vendor': 'postgresql',
|
2014-03-14 17:34:49 +00:00
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
2014-09-05 20:53:11 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='CharFieldModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
|
|
('field', models.CharField(max_length=16)),
|
|
|
|
],
|
|
|
|
options=None,
|
|
|
|
bases=None,
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='TextFieldModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
|
|
('field', models.TextField()),
|
|
|
|
],
|
|
|
|
options=None,
|
|
|
|
bases=None,
|
|
|
|
),
|
2015-05-31 21:45:03 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='Scene',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
|
|
('scene', models.CharField(max_length=255)),
|
|
|
|
('setting', models.CharField(max_length=255)),
|
|
|
|
],
|
|
|
|
options=None,
|
|
|
|
bases=None,
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Character',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
|
|
('name', models.CharField(max_length=255)),
|
|
|
|
],
|
|
|
|
options=None,
|
|
|
|
bases=None,
|
2016-06-01 21:43:59 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2017-02-11 12:16:35 +00:00
|
|
|
name='CITestModel',
|
2016-06-01 21:43:59 +00:00
|
|
|
fields=[
|
2017-02-11 12:16:35 +00:00
|
|
|
('name', CICharField(primary_key=True, max_length=255)),
|
|
|
|
('email', CIEmailField()),
|
|
|
|
('description', CITextField()),
|
2017-05-03 05:25:30 +00:00
|
|
|
('array_field', ArrayField(CITextField(), null=True)),
|
2016-06-01 21:43:59 +00:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'required_db_vendor': 'postgresql',
|
|
|
|
},
|
|
|
|
bases=None,
|
2015-05-31 21:45:03 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Line',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
|
|
('scene', models.ForeignKey('postgres_tests.Scene', on_delete=models.SET_NULL)),
|
|
|
|
('character', models.ForeignKey('postgres_tests.Character', on_delete=models.SET_NULL)),
|
|
|
|
('dialogue', models.TextField(blank=True, null=True)),
|
|
|
|
('dialogue_search_vector', SearchVectorField(blank=True, null=True)),
|
|
|
|
('dialogue_config', models.CharField(max_length=100, blank=True, null=True)),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'required_db_vendor': 'postgresql',
|
|
|
|
},
|
|
|
|
bases=None,
|
|
|
|
),
|
2015-02-08 15:21:48 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='AggregateTestModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2017-05-06 14:56:28 +00:00
|
|
|
('boolean_field', models.BooleanField(null=True)),
|
2015-02-08 15:21:48 +00:00
|
|
|
('char_field', models.CharField(max_length=30, blank=True)),
|
|
|
|
('integer_field', models.IntegerField(null=True)),
|
|
|
|
]
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='StatTestModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
|
|
('int1', models.IntegerField()),
|
|
|
|
('int2', models.IntegerField()),
|
2015-07-22 14:43:21 +00:00
|
|
|
('related_field', models.ForeignKey(
|
|
|
|
'postgres_tests.AggregateTestModel',
|
|
|
|
models.SET_NULL,
|
|
|
|
null=True,
|
|
|
|
)),
|
2015-02-08 15:21:48 +00:00
|
|
|
]
|
|
|
|
),
|
2015-06-01 17:00:34 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='NowTestModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
|
|
('when', models.DateTimeField(null=True, default=None)),
|
|
|
|
]
|
2017-03-29 21:52:42 +00:00
|
|
|
),
|
|
|
|
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)),
|
|
|
|
]
|
2015-06-01 17:00:34 +00:00
|
|
|
),
|
2015-01-10 16:14:20 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='RangesModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2015-04-04 16:10:26 +00:00
|
|
|
('ints', IntegerRangeField(null=True, blank=True)),
|
|
|
|
('bigints', BigIntegerRangeField(null=True, blank=True)),
|
2018-10-02 23:17:23 +00:00
|
|
|
('decimals', DecimalRangeField(null=True, blank=True)),
|
2015-04-04 16:10:26 +00:00
|
|
|
('timestamps', DateTimeRangeField(null=True, blank=True)),
|
|
|
|
('dates', DateRangeField(null=True, blank=True)),
|
2015-01-10 16:14:20 +00:00
|
|
|
],
|
2015-05-21 11:25:50 +00:00
|
|
|
options={
|
|
|
|
'required_db_vendor': 'postgresql'
|
|
|
|
},
|
|
|
|
bases=(models.Model,)
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='RangeLookupsModel',
|
|
|
|
fields=[
|
2015-07-22 14:43:21 +00:00
|
|
|
('parent', models.ForeignKey(
|
|
|
|
'postgres_tests.RangesModel',
|
|
|
|
models.SET_NULL,
|
|
|
|
blank=True, null=True,
|
|
|
|
)),
|
2015-05-21 11:25:50 +00:00
|
|
|
('integer', models.IntegerField(blank=True, null=True)),
|
|
|
|
('big_integer', models.BigIntegerField(blank=True, null=True)),
|
|
|
|
('float', models.FloatField(blank=True, null=True)),
|
|
|
|
('timestamp', models.DateTimeField(blank=True, null=True)),
|
|
|
|
('date', models.DateField(blank=True, null=True)),
|
|
|
|
],
|
2015-01-10 16:14:20 +00:00
|
|
|
options={
|
2015-04-04 16:10:26 +00:00
|
|
|
'required_db_vendor': 'postgresql',
|
2015-01-10 16:14:20 +00:00
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
2015-05-30 21:13:58 +00:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='JSONModel',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
|
|
('field', JSONField(null=True, blank=True)),
|
2016-08-11 19:05:52 +00:00
|
|
|
('field_custom', JSONField(null=True, blank=True, encoder=DjangoJSONEncoder)),
|
2015-05-30 21:13:58 +00:00
|
|
|
],
|
|
|
|
options={
|
2017-09-06 14:26:45 +00:00
|
|
|
'required_db_vendor': 'postgresql',
|
2015-05-30 21:13:58 +00:00
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
]
|