File: 0002_test_unique_nullable_part1.py

package info (click to toggle)
mssql-django 1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 644 kB
  • sloc: python: 5,289; sh: 105; makefile: 7
file content (21 lines) | stat: -rw-r--r-- 772 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('testapp', '0001_initial'),
    ]

    operations = [
        # Prep test for issue https://github.com/ESSolutions/django-mssql-backend/issues/38
        # Create with a field that is unique *and* nullable so it is implemented with a filtered unique index.
        migrations.CreateModel(
            name='TestUniqueNullableModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('test_field', models.CharField(max_length=100, null=True, unique=True)),
                ('y', models.IntegerField(unique=True, null=True)),
            ],
        ),
    ]