# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-05-27 23:31
from __future__ import unicode_literals

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


# Functions from the following migrations need manual copying.
# Move them and any dependencies into this file, then update the
# RunPython operations to refer to the local versions:
# api.migrations.0002_add_test_data

class Migration(migrations.Migration):

    replaces = [
        (b'api', '0001_initial'),
        (b'api', '0002_add_test_data'),
        (b'api', '0003_remove_server_public_secret'),
        (b'api', '0004_characterhistory'),
        (b'api', '0005_ginfocharacter'),
        (b'api', '0006_clan'),
        (b'api', 'add_clan_id'),
        (b'api', '0001_server_ip_address'),
        (b'api', '0002_clean_data_schema'),
        (b'api', '0003_add_server_fields'),
        (b'api', '0004_server_version'),
        (b'api', '0005_make_location_nullable')
    ]

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Character',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField()),
                ('level', models.IntegerField()),
                ('is_online', models.BooleanField()),
                ('steam_id', models.TextField()),
                ('conan_id', models.TextField()),
                ('last_online', models.DateTimeField(null=True)),
                ('last_killed_by', models.TextField(null=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('x', models.FloatField()),
                ('y', models.FloatField()),
                ('z', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='Server',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField()),
                ('public_secret', models.UUIDField()),
                ('private_secret', models.UUIDField()),
                ('last_sync', models.DateTimeField(null=True)),
            ],
        ),
        migrations.AddField(
            model_name='character',
            name='server',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Server'),
        ),
        migrations.RemoveField(
            model_name='server',
            name='public_secret',
        ),
        migrations.CreateModel(
            name='CharacterHistory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('x', models.FloatField()),
                ('y', models.FloatField()),
                ('z', models.FloatField()),
                ('character', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='history', to='api.Character')),
            ],
        ),
        migrations.CreateModel(
            name='GinfoCharacter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ginfo_marker_uid', models.TextField()),
                ('character', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ginfo_character', related_query_name='ginfo_character', to='api.Character')),
            ],
        ),
        migrations.CreateModel(
            name='Clan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField()),
                ('conan_id', models.TextField()),
                ('conan_owner_id', models.TextField()),
                ('motd', models.TextField()),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('server', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Server')),
            ],
        ),
        migrations.AddField(
            model_name='character',
            name='conan_clan_id',
            field=models.TextField(null=True),
        ),
        migrations.AlterField(
            model_name='character',
            name='server',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='characters', to='api.Server'),
        ),
        migrations.AddField(
            model_name='server',
            name='ip_address',
            field=models.TextField(default=b''),
        ),
        migrations.CreateModel(
            name='ServerSyncData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('data', models.TextField()),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('server', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='api.Server')),
            ],
        ),
        migrations.AddField(
            model_name='character',
            name='clan',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='members', to='api.Clan'),
        ),
        migrations.AddField(
            model_name='clan',
            name='owner',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='owner', to='api.Character'),
        ),
        migrations.AlterField(
            model_name='clan',
            name='server',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='clans', to='api.Server'),
        ),
        migrations.AddField(
            model_name='server',
            name='max_players',
            field=models.IntegerField(null=True),
        ),
        migrations.AddField(
            model_name='server',
            name='query_port',
            field=models.TextField(null=True),
        ),
        migrations.AddField(
            model_name='server',
            name='tick_rate',
            field=models.IntegerField(null=True),
        ),
        migrations.AddField(
            model_name='server',
            name='version',
            field=models.TextField(null=True),
        ),
        migrations.AlterField(
            model_name='character',
            name='x',
            field=models.FloatField(null=True),
        ),
        migrations.AlterField(
            model_name='character',
            name='y',
            field=models.FloatField(null=True),
        ),
        migrations.AlterField(
            model_name='character',
            name='z',
            field=models.FloatField(null=True),
        ),
    ]
