# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-12-05 02:40
from __future__ import unicode_literals

import django.contrib.postgres.fields.jsonb
import django.core.serializers.json
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoryRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('action', models.CharField(choices=[('auction/new', 'Auction created'), ('auction/start', 'Auction started'), ('auction/finish', 'Auction finished'), ('auction/cancel', 'Auction cancelled'), ('auction/payment', 'Auction payment done'), ('user/signup', 'User signed up'), ('user/signup-verify', 'User verified signup'), ('user/signup-facebook', 'User signed up with Facebook'), ('user/update-details', 'User updated details'), ('user/update-payment', 'User updated payment'), ('user/won', 'User bid on an auction'), ('user/won', 'User won an auction'), ('user/lost', 'User lost an auction')], max_length=50)),
                ('extra', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=None, encoder=django.core.serializers.json.DjangoJSONEncoder, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='HistoryRecordEntity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
            options={
                'verbose_name_plural': 'HistoryRecordEntities',
            },
        ),
        migrations.AddField(
            model_name='historyrecord',
            name='subject',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='subject', to='history.HistoryRecordEntity'),
        ),
        migrations.AddField(
            model_name='historyrecord',
            name='target',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='target', to='history.HistoryRecordEntity'),
        ),
    ]
