# Generated by Django 2.2.2 on 2019-06-24 08:21

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Hashtag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name_local', models.CharField(db_index=True, max_length=100)),
                ('name_en', models.CharField(db_index=True, max_length=100)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'db_table': 'hash_tag',
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('post_code', models.CharField(max_length=16, unique=True)),
                ('post_type', models.CharField(blank=True, choices=[('CONTENT', 'Click'), ('STATUS', 'Status'), ('VIDEO', 'Video'), ('STREAM', 'Stream'), ('IMAGE', 'Image')], max_length=30, null=True)),
                ('link', models.TextField(max_length=500)),
                ('rating', models.FloatField(default=0)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'db_table': 'posts',
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='PostHashTag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hash_tags', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='hash_tags', to='posts.Hashtag')),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tag_posts', to='posts.Post')),
            ],
            options={
                'db_table': 'post_hash_tag',
            },
        ),
        migrations.CreateModel(
            name='PostAction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type_action', models.CharField(choices=[('CLICK', 'Click'), ('VIEW', 'View'), ('LIKE', 'Like'), ('COMMENT', 'Comment'), ('SHARE', 'Share')], max_length=30)),
                ('quantity', models.IntegerField(default=0)),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posts', to='posts.Post')),
            ],
            options={
                'db_table': 'post_action',
                'ordering': ['-id'],
            },
        ),
        migrations.AddField(
            model_name='post',
            name='hash_tag',
            field=models.ManyToManyField(related_name='hash_tag', through='posts.PostHashTag', to='posts.Hashtag'),
        ),
        migrations.AddField(
            model_name='post',
            name='influencer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='influencer', to='influencers.Influencers'),
        ),
        migrations.AddField(
            model_name='post',
            name='social',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='post_social', to='influencers.Social'),
        ),
        migrations.AddField(
            model_name='post',
            name='topic_tag',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='post_topic_tag', to='influencers.TopicTag'),
        ),
    ]
