# Generated by Django 3.0.6 on 2020-06-08 04:45

from django.db import migrations

from scraping.models import Country, City, Language, Category, GenderType, AgeInterval, Interval


def create_model(model):
    model.save()
    return model


def init_data(apps, schema_editor):
    # Country
    country_kz = create_model(Country(title="Kazakhstan", hype_id="1522867"))

    # City
    create_model(City(title="Aktau", hype_id="610612", country=country_kz))
    create_model(City(title="Aqtobe", hype_id="610611", country=country_kz))
    create_model(City(title="Almaty", hype_id="1526384", country=country_kz))
    create_model(City(title="Atyrau", hype_id="610529", country=country_kz))
    create_model(City(title="Baikonur", hype_id="1521368", country=country_kz))
    create_model(City(title="Balqash", hype_id="1525798", country=country_kz))
    create_model(City(title="Karagandy", hype_id="609655", country=country_kz))
    create_model(City(title="Kentau", hype_id="1522751", country=country_kz))
    create_model(City(title="Kyzylorda", hype_id="1519922", country=country_kz))
    create_model(City(title="Kokshetau", hype_id="1522203", country=country_kz))
    create_model(City(title="Kostanay", hype_id="1519928", country=country_kz))
    create_model(City(title="Astana", hype_id="1526273", country=country_kz))
    create_model(City(title="Zhanaozen", hype_id="607610", country=country_kz))
    create_model(City(title="Pavlodar", hype_id="1520240", country=country_kz))
    create_model(City(title="Petropavl", hype_id="1520172", country=country_kz))
    create_model(City(title="Semey", hype_id="1519422", country=country_kz))
    create_model(City(title="Taldykorgan", hype_id="1518542", country=country_kz))
    create_model(City(title="Taraz", hype_id="1516905", country=country_kz))
    create_model(City(title="Oral", hype_id="608668", country=country_kz))
    create_model(City(title="Shymkent", hype_id="1518980", country=country_kz))
    create_model(City(title="Ekibastuz", hype_id="1524325", country=country_kz))

    # Category
    create_model(Category(title="Accessories & Jewellery", hype_id="1000"))
    create_model(Category(title="Adult content", hype_id="1048"))
    create_model(Category(title="Alcohol", hype_id="1001"))
    create_model(Category(title="Animals", hype_id="1026"))
    create_model(Category(title="Architecture & Urban Design", hype_id="1003"))
    create_model(Category(title="Art/Artists", hype_id="1002"))
    create_model(Category(title="Beauty", hype_id="1020"))
    create_model(Category(title="Business & Careers", hype_id="1005"))
    create_model(Category(title="Cars & Motorbikes", hype_id="1018"))
    create_model(Category(title="Cinema & Actors/actresses", hype_id="1032"))
    create_model(Category(title="Clothing & Outfits", hype_id="1007"))
    create_model(Category(title="Comics & sketches", hype_id="1016"))
    create_model(Category(title="Computers & Gadgets", hype_id="1034"))
    create_model(Category(title="DIY & Design", hype_id="1037"))
    create_model(Category(title="Education", hype_id="1033"))
    create_model(Category(title="Extreme Sports & Outdoor activity", hype_id="1014"))
    create_model(Category(title="Family", hype_id="1042"))
    create_model(Category(title="Fashion", hype_id="1021"))
    create_model(Category(title="Finance & Economics", hype_id="1006"))
    create_model(Category(title="Fitness & Gym", hype_id="1023"))
    create_model(Category(title="Food & Cooking", hype_id="1035"))
    create_model(Category(title="Health & Medicine", hype_id="1022"))
    create_model(Category(title="Humor & Fun & Happiness", hype_id="1036"))
    create_model(Category(title="Kids & Toys", hype_id="1046"))
    create_model(Category(title="Lifestyle", hype_id="1041"))
    create_model(Category(title="Literature & Journalism", hype_id="1004"))
    create_model(Category(title="Luxury", hype_id="1043"))
    create_model(Category(title="Machinery & Technologies", hype_id="1030"))
    create_model(Category(title="Management & Marketing", hype_id="1044"))
    create_model(Category(title="Mobile related", hype_id="1010"))
    create_model(Category(title="Modeling", hype_id="1039"))
    create_model(Category(title="Music", hype_id="1027"))
    create_model(Category(title="Nature & landscapes", hype_id="1025"))
    create_model(Category(title="Photography", hype_id="1038"))
    create_model(Category(title="Racing Sports", hype_id="1015"))
    create_model(Category(title="Science", hype_id="1029"))
    create_model(Category(title="Shopping & Retail", hype_id="1028"))
    create_model(Category(title="Shows", hype_id="1017"))
    create_model(Category(title="Sports with a ball", hype_id="1013"))
    create_model(Category(title="Sweets & Bakery", hype_id="1019"))
    create_model(Category(title="Tobacco & Smoking", hype_id="1047"))
    create_model(Category(title="Trainers & Coaches", hype_id="1031"))
    create_model(Category(title="Travel", hype_id="1009"))
    create_model(Category(title="Water sports", hype_id="1011"))
    create_model(Category(title="Winter sports", hype_id="1012"))

    # Gender Type
    create_model(GenderType(title="Male", hype_id="1"))
    create_model(GenderType(title="Female", hype_id="2"))

    # Age Interval
    create_model(AgeInterval(title="13-17", hype_start_id=13, hype_end_id=17))
    create_model(AgeInterval(title="18-24", hype_start_id=18, hype_end_id=24))
    create_model(AgeInterval(title="25-34", hype_start_id=25, hype_end_id=34))
    create_model(AgeInterval(title="35-44", hype_start_id=35, hype_end_id=44))
    create_model(AgeInterval(title="45-54", hype_start_id=45, hype_end_id=54))
    create_model(AgeInterval(title="55-64", hype_start_id=55, hype_end_id=64))
    create_model(AgeInterval(title="65<", hype_start_id=65, hype_end_id=None))

    # Language
    create_model(Language(title="English", hype_id="en"))
    create_model(Language(title="Russian", hype_id="ru"))
    create_model(Language(title="Kazakh", hype_id="kk"))
    create_model(Language(title="Turkish", hype_id="tr"))

    # Interval
    create_model(Interval(title="10", hype_id="10"))
    create_model(Interval(title="20", hype_id="20"))
    create_model(Interval(title="30", hype_id="30"))
    create_model(Interval(title="40", hype_id="40"))
    create_model(Interval(title="50", hype_id="50"))
    create_model(Interval(title="60", hype_id="60"))
    create_model(Interval(title="70", hype_id="70"))
    create_model(Interval(title="80", hype_id="80"))
    create_model(Interval(title="90", hype_id="90"))


class Migration(migrations.Migration):
    dependencies = [
        ('scraping', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(init_data),
    ]
