# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-19 18:10
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        ('budget', '0022_package_print_system_slug'),
    ]

    operations = [
        migrations.CreateModel(
            name='Change',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('at', models.DateTimeField(auto_now=True)),
                ('by', models.PositiveSmallIntegerField(db_index=True)),
                ('item_content_type', models.CharField(db_index=True, max_length=30)),
                ('item_id', models.PositiveIntegerField(db_index=True)),
            ],
            options={
                'ordering': ['-at'],
            },
        ),
        migrations.RenameField(
            model_name='package',
            old_name='last_changed_by',
            new_name='last_changed_by_old',
        ),
        migrations.RenameField(
            model_name='package',
            old_name='created_by',
            new_name='created_by_old',
        ),
        migrations.AddField(
            model_name='item',
            name='created_at',
            field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='item',
            name='created_by',
            field=models.PositiveSmallIntegerField(db_index=True, null=True),
        ),
        migrations.AddField(
            model_name='package',
            name='created_at',
            field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='package',
            name='created_by',
            field=models.PositiveSmallIntegerField(db_index=True, null=True),
        ),
        migrations.AddField(
            model_name='change',
            name='package',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='related_changes', to='budget.Package'),
        ),
    ]
