# Generated by Django 2.0.7 on 2019-02-14 19:02

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('tracker', '0016_auto_20190210_1422'),
    ]

    operations = [
        migrations.CreateModel(
            name='ChainHeight',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('network', models.CharField(max_length=100)),
                ('height', models.IntegerField()),
            ],
            options={
                'managed': False,
            },
        ),
        migrations.RunSQL(
            """
             CREATE MATERIALIZED VIEW tracker_chainheight AS SELECT network, MAX(block_height) AS height
             FROM tracker_processedblock
             GROUP BY network;
             CREATE UNIQUE INDEX tracker_chainheight_network_unique ON tracker_chainheight (network);
            """,
            """
             DROP MATERIALIZED VIEW tracker_chainheight
            """
        )
    ]

# Generated by Django 2.0.7 on 2019-02-14 19:02

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('tracker', '0016_auto_20190210_1422'),
    ]

    operations = [
        migrations.CreateModel(
            name='ChainHeight',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('network', models.CharField(max_length=100)),
                ('height', models.IntegerField()),
            ],
            options={
                'managed': False,
            },
        ),
        migrations.RunSQL(
            """
             CREATE MATERIALIZED VIEW tracker_chainheight AS SELECT network, MAX(block_height) AS height
             FROM tracker_processedblock
             GROUP BY network;
             CREATE UNIQUE INDEX tracker_chainheight_network_unique ON tracker_chainheight (network);
            """,
            """
             DROP MATERIALIZED VIEW tracker_chainheight
            """
        )
    ]

# Generated by Django 2.0.7 on 2019-02-14 19:02 CREATE MATERIALIZED VIEW tracker_chainheight AS SELECT network, MAX(block_height) AS height              FROM tracker_processedblock              GROUP BY network;              CREATE UNIQUE INDEX tracker_chainheight_network_unique ON tracker_chainheight (network); DROP MATERIALIZED VIEW tracker_chainheight