# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-02 09:25
from __future__ import unicode_literals

from django.db import migrations

SQL = """
CREATE INDEX CONCURRENTLY values_value_field_string_value_concat
ON values_value((contact_field_id || '|' || UPPER(string_value)));

CREATE INDEX CONCURRENTLY values_value_field_datetime_value_not_null
ON values_value(contact_field_id, datetime_value)
WHERE contact_field_id IS NOT NULL AND datetime_value IS NOT NULL;

CREATE INDEX CONCURRENTLY values_value_field_decimal_value_not_null
ON values_value(contact_field_id, decimal_value)
WHERE contact_field_id IS NOT NULL AND decimal_value IS NOT NULL;

ANALYZE values_value;
"""


class Migration(migrations.Migration):

    dependencies = [
        ('values', '0009_install_indexes'),
    ]

    operations = [
        migrations.RunSQL(SQL)
    ]

# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-02 09:25
from __future__ import unicode_literals

from django.db import migrations

SQL = """
CREATE INDEX CONCURRENTLY values_value_field_string_value_concat
ON values_value((contact_field_id || '|' || UPPER(string_value)));

CREATE INDEX CONCURRENTLY values_value_field_datetime_value_not_null
ON values_value(contact_field_id, datetime_value)
WHERE contact_field_id IS NOT NULL AND datetime_value IS NOT NULL;

CREATE INDEX CONCURRENTLY values_value_field_decimal_value_not_null
ON values_value(contact_field_id, decimal_value)
WHERE contact_field_id IS NOT NULL AND decimal_value IS NOT NULL;

ANALYZE values_value;
"""


class Migration(migrations.Migration):

    atomic = False

    dependencies = [
        ('values', '0009_install_indexes'),
    ]

    operations = [
        migrations.RunSQL(SQL)
    ]

Make migration non-atomic