# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-04-22 22:27
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='CustomUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activation_key', models.CharField(max_length=255, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Game',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('url', models.CharField(max_length=500)),
                ('price', models.DecimalField(decimal_places=2, max_digits=5)),
                ('image', models.ImageField(blank=True, null=True, upload_to='')),
            ],
        ),
        migrations.CreateModel(
            name='Highscore',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('score', models.FloatField()),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='atoj_games.Game')),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=5)),
                ('completion_date', models.DateTimeField(auto_now=True)),
                ('payment_app_ref', models.IntegerField()),
                ('bought_game', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='atoj_games.Game')),
            ],
        ),
        migrations.CreateModel(
            name='PendingPayment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=5)),
                ('creation_date', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='SaveGame',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('data', models.TextField()),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='atoj_games.Game')),
            ],
        ),
        migrations.CreateModel(
            name='Setting',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('value', models.CharField(max_length=1000)),
            ],
        ),
        migrations.CreateModel(
            name='Developer',
            fields=[
                ('customuser_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='atoj_games.CustomUser')),
                ('api_key', models.CharField(max_length=255, null=True, unique=True)),
            ],
            bases=('atoj_games.customuser',),
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('customuser_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='atoj_games.CustomUser')),
            ],
            bases=('atoj_games.customuser',),
        ),
        migrations.AddField(
            model_name='savegame',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='atoj_games.CustomUser'),
        ),
        migrations.AddField(
            model_name='pendingpayment',
            name='buyer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='atoj_games.CustomUser'),
        ),
        migrations.AddField(
            model_name='pendingpayment',
            name='game',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='atoj_games.Game'),
        ),
        migrations.AddField(
            model_name='payment',
            name='buyer',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='atoj_games.CustomUser'),
        ),
        migrations.AddField(
            model_name='highscore',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='atoj_games.CustomUser'),
        ),
        migrations.AddField(
            model_name='game',
            name='bought_by_user',
            field=models.ManyToManyField(blank=True, to='atoj_games.CustomUser'),
        ),
        migrations.AddField(
            model_name='customuser',
            name='user',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='savegame',
            unique_together=set([('game', 'user')]),
        ),
        migrations.AddField(
            model_name='game',
            name='developer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atoj_games_game_related', to='atoj_games.Developer'),
        ),
    ]
