<reponame>m-den-i/swiftwind
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-06 01:42
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('costs', '0013_auto_20171203_1516'),
    ]

    operations = [
        migrations.RunSQL(
            "ALTER TABLE costs_recurringcost DROP CONSTRAINT check_disabled_xor_initial_billing_cycle",
            """
            ALTER TABLE costs_recurringcost ADD CONSTRAINT check_disabled_xor_initial_billing_cycle
            CHECK (
                (disabled AND initial_billing_cycle_id IS NULL)
                OR
                (NOT disabled AND initial_billing_cycle_id IS NOT NULL)
            )
            """,
        )
    ]
