# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2021-04-13 19:23
from __future__ import unicode_literals

import datetime
import django
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('dataentry', '0178_auto_20210412_1517'),
    ]

    operations = [
        
        migrations.AddField(
            model_name='locationstaff',
            name='modified_date',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name='locationstatistics',
            name='modified_date',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name='stationstatistics',
            name='active_monitor_locations',
            field=models.PositiveIntegerField(null=True),
        ),
        migrations.AddField(
            model_name='stationstatistics',
            name='modified_date',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name='locationstatistics',
            name='intercepts_evidence',
            field=models.PositiveIntegerField(null=True),
        ),
        migrations.AddField(
            model_name='locationstatistics',
            name='intercepts_high_risk',
            field=models.PositiveIntegerField(null=True),
        ),
        migrations.AddField(
            model_name='locationstatistics',
            name='intercepts_invalid',
            field=models.PositiveIntegerField(null=True),
        ),
         migrations.RunSQL("update dataentry_stationstatistics ss set active_monitor_locations="\
                          "(select count(*) from static_border_stations_location where border_station_id=ss.station_id and "\
                                "location_type='monitoring' and active=true)"),
        
    ]
