# Generated by Django 2.1.2 on 2018-11-13 21:36

from django.db import migrations


def create_configs(apps, schema_editor):
    db_alias = schema_editor.connection.alias
    Configuration = apps.get_model("booru", "Configuration")
    Configuration.objects.using(db_alias).create(code_name="site_title", value="Boorunaut")
    Configuration.objects.using(db_alias).create(code_name="google_analytics_id", value="")
    Configuration.objects.using(db_alias).create(code_name="terms_of_service", value="")
    Configuration.objects.using(db_alias).create(code_name="privacy_policy", value="")

def create_types(apps, schema_editor):
    db_alias = schema_editor.connection.alias
    Category = apps.get_model("booru", "Category")
    Category.objects.using(db_alias).create(label="general", title_singular="General",
                                            title_plural="General", color="")
    Category.objects.using(db_alias).create(label="artist", title_singular="Artist",
                                            title_plural="Artists", color="BB6666")
    Category.objects.using(db_alias).create(label="copyright", title_singular="Copyright",
                                            title_plural="Copyrights", color="AA00AA")
    Category.objects.using(db_alias).create(label="character", title_singular="Character",
                                            title_plural="Characters", color="66BB66"),
    Category.objects.using(db_alias).create(label="meta", title_singular="Meta",
                                            title_plural="Meta", color="FF8800")


class Migration(migrations.Migration):

    dependencies = [
        ('booru', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(create_configs),
        migrations.RunPython(create_types),
    ]
