# Generated by Django 2.1.3 on 2019-01-01 19:48

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('stats', '0001_initial'),
        ('repos', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AssetChangeItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('field', models.CharField(db_index=True, max_length=32)),
                ('new_value', models.TextField(blank=True, null=True)),
                ('old_value', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='AssetChangeset',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('remote_addr', models.CharField(max_length=32, null=True)),
                ('object_id', models.PositiveIntegerField(db_index=True)),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('target', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='stats.StatsTarget')),
            ],
        ),
        migrations.CreateModel(
            name='Bot',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('location', models.CharField(db_index=True, max_length=64)),
                ('filter_mode', models.PositiveSmallIntegerField(choices=[(0, 'Unknown'), (1, 'Inactive'), (2, 'Custom filter'), (3, 'Filter by project')], default=0)),
                ('custom_ruleset', models.TextField(blank=True, verbose_name='Custom ruleset')),
                ('project_list', models.TextField(blank=True, verbose_name='Project list')),
                ('show_project_names', models.BooleanField(choices=[(False, 'No'), (True, 'Yes')], default=True, verbose_name='Show project names')),
            ],
        ),
        migrations.CreateModel(
            name='Network',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uri', models.CharField(max_length=128)),
                ('description', models.CharField(max_length=200)),
                ('is_popular', models.BooleanField(default=False)),
                ('reviewed_by_admin', models.BooleanField(default=False)),
                ('date_added', models.DateTimeField(auto_now_add=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('secret_key', models.CharField(max_length=64, null=True)),
                ('allow_anonymous_messages', models.BooleanField(choices=[(False, 'No'), (True, 'Yes')], default=True)),
                ('allow_trusted_messages', models.BooleanField(choices=[(False, 'No'), (True, 'Yes')], default=True)),
                ('repos', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='repos.Repository')),
                ('target', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='stats.StatsTarget')),
            ],
        ),
        migrations.CreateModel(
            name='UserAsset',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('access', models.PositiveSmallIntegerField(choices=[(0, 'Give up ownership'), (1, 'Community access'), (2, 'Exclusive access'), (3, 'Trusted')], default=1)),
                ('date_added', models.DateTimeField(auto_now_add=True)),
                ('trusted_by', models.DateTimeField(blank=True, null=True)),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='bot',
            name='network',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.Network'),
        ),
        migrations.AddField(
            model_name='assetchangeitem',
            name='changeset',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='accounts.AssetChangeset'),
        ),
    ]
