# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2021-03-29 18:27
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('dataentry', '0176_clientdiagnostic'),
    ]

    operations = [
        migrations.AddField(
            model_name='permission',
            name='display_order',
            field=models.IntegerField(default=-1),
        ),
        migrations.RunSQL("update dataentry_permission set display_order=1 where action='VIEW'"),
        migrations.RunSQL("update dataentry_permission set display_order=2 where action='VIEW PI'"),
        migrations.RunSQL("update dataentry_permission set display_order=3 where action='EDIT'"),
        migrations.RunSQL("update dataentry_permission set display_order=4 where action='ADD'"),
        migrations.RunSQL("update dataentry_permission set display_order=5 where action='DELETE'"),
        migrations.RunSQL("update dataentry_permission set display_order=2 where action='SUBMIT_SAMPLE'"),
        migrations.RunSQL("update dataentry_permission set display_order=6 where action='SET_FORMS'"),
        migrations.RunSQL("delete from dataentry_userlocationpermission where permission_id in (select id from dataentry_permission where action='APPROVE')"),
        migrations.RunSQL("delete from dataentry_permission where action='APPROVE'"),
    ]
