# Generated by Django 2.1.8 on 2019-05-23 17:29

from django.db import migrations
import migrate_sql.operations


class Migration(migrations.Migration):

    dependencies = [
        ('pyfb_endpoint', '0010_customerendpoint_domain'),
    ]

    operations = [
        migrate_sql.operations.ReverseAlterSQL(
            name='subscriber_view',
            sql='DROP VIEW IF EXISTS subscriber CASCADE; ',
            reverse_sql="DROP VIEW IF EXISTS subscriber CASCADE; CREATE OR REPLACE VIEW subscriber AS  SELECT row_number() OVER () AS id,  c.name AS username,  CAST('' AS VARCHAR) AS domain,  c.password FROM pyfb_endpoint_customer c WHERE c.enabled=True and c.registration=True;",
        ),
        migrate_sql.operations.AlterSQL(
            name='subscriber_view',
            sql='DROP VIEW IF EXISTS subscriber CASCADE; CREATE OR REPLACE VIEW subscriber AS  SELECT row_number() OVER () AS id,  c.name AS username,  d.domain AS domain,  c.password FROM pyfb_endpoint_customer c LEFT JOIN domain d  ON c.domain_id = d.id WHERE c.enabled=True and c.registration=True;',
            reverse_sql='DROP VIEW IF EXISTS subscriber CASCADE; ',
        ),
    ]
