# Generated by Django 2.1.2 on 2018-10-17 07:23

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [("coursera", "0033_create_on_demand_sessions_view")]

    operations = [
        migrations.RunSQL(
            [
                """
                CREATE MATERIALIZED VIEW
                    users_view
                AS
                SELECT
                    eitdigital_user_id,
                    user_join_ts,
                    country_cd,
                    region_cd,
                    profile_language_cd,
                    browser_language_cd,
                    reported_or_inferred_gender,
                    employment_status,
                    educational_attainment,
                    student_status
                FROM
                    users
                """,
                """
                CREATE UNIQUE INDEX ON users_view (eitdigital_user_id)
                """,
            ],
            reverse_sql="DROP MATERIALIZED VIEW IF EXISTS users_view",
        )
    ]
