<gh_stars>10-100
# Generated by Django 3.1.2 on 2020-10-12 12:33

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("awt", "0011_absence_ends_on"),
    ]

    operations = [
        migrations.AddField(
            model_name="absence",
            name="is_working_time",
            field=models.BooleanField(default=True, verbose_name="is working time"),
        ),
        migrations.AlterField(
            model_name="absence",
            name="reason",
            field=models.CharField(
                choices=[
                    ("vacation", "vacation"),
                    ("sickness", "sickness"),
                    ("paid", "paid leave (e.g. civilian service, maternity etc.)"),
                    ("other", "other reasons (no working time)"),
                    ("correction", "Working time correction"),
                ],
                max_length=10,
                verbose_name="reason",
            ),
        ),
        migrations.RunSQL(
            """
UPDATE awt_absence
SET reason='paid'
WHERE starts_on<'2020-01-01' AND reason='other';

UPDATE awt_absence
SET is_working_time=FALSE
WHERE reason='other';
            """,
            "",
        ),
    ]

# Generated by Django 3.1.2 on 2020-10-12 12:33

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("awt", "0011_absence_ends_on"),
    ]

    operations = [
        migrations.AddField(
            model_name="absence",
            name="is_working_time",
            field=models.BooleanField(default=True, verbose_name="is working time"),
        ),
        migrations.AlterField(
            model_name="absence",
            name="reason",
            field=models.CharField(
                choices=[
                    ("vacation", "vacation"),
                    ("sickness", "sickness"),
                    ("paid", "paid leave (e.g. civilian service, maternity etc.)"),
                    ("other", "other reasons (no working time)"),
                    ("correction", "Working time correction"),
                ],
                max_length=10,
                verbose_name="reason",
            ),
        ),
        migrations.RunSQL(
            """
UPDATE awt_absence
SET reason='paid'
WHERE starts_on<'2020-01-01' AND reason='other';

UPDATE awt_absence
SET is_working_time=FALSE
WHERE reason='other';
            """,
            "",
        ),
    ]
# Generated by Django 3.1.2 on 2020-10-12 12:33 UPDATE awt_absence SET reason='paid' WHERE starts_on<'2020-01-01' AND reason='other';  UPDATE awt_absence SET is_working_time=FALSE WHERE reason='other';