# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-11-25 22:26
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Hashtag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hashtag', models.CharField(max_length=100, unique=True, verbose_name='hashtag')),
            ],
            options={
                'verbose_name_plural': 'hashtags',
                'db_table': 'hashtag',
                'verbose_name': 'hashtag',
            },
        ),
        migrations.CreateModel(
            name='HashtagUrl',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hashtag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='twitter_connector.Hashtag')),
            ],
            options={
                'verbose_name_plural': 'hashtagurls',
                'db_table': 'hashtag_url',
                'verbose_name': 'hashtagurl',
            },
        ),
        migrations.CreateModel(
            name='Tweet',
            fields=[
                ('id', models.BigIntegerField(primary_key=True, serialize=False, unique=True)),
                ('created_at', models.DateTimeField(verbose_name='created_at')),
                ('timestamp_ms', models.BigIntegerField(verbose_name='timestamp_ms')),
                ('text', models.CharField(max_length=150, verbose_name='text')),
                ('retweet_count', models.IntegerField(verbose_name='retweet_count')),
                ('favorite_count', models.IntegerField(verbose_name='favorite_count')),
            ],
            options={
                'verbose_name_plural': 'tweets',
                'db_table': 'tweet',
                'verbose_name': 'tweet',
            },
        ),
        migrations.CreateModel(
            name='TweetUrl',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tweet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='twitter_connector.Tweet')),
            ],
            options={
                'verbose_name_plural': 'tweeturls',
                'db_table': 'tweet_url',
                'verbose_name': 'tweeturl',
            },
        ),
        migrations.CreateModel(
            name='Url',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url', models.TextField(unique=True, verbose_name='url')),
                ('expanded_url', models.TextField(verbose_name='expanded_url')),
                ('created_at', models.DateTimeField(default=datetime.datetime.utcnow, verbose_name='created_at')),
                ('modified_at', models.DateTimeField(default=datetime.datetime.utcnow, verbose_name='modified_at')),
            ],
            options={
                'verbose_name_plural': 'urls',
                'db_table': 'url',
                'verbose_name': 'url',
            },
        ),
        migrations.AlterUniqueTogether(
            name='url',
            unique_together=set([('id', 'url')]),
        ),
        migrations.AddField(
            model_name='tweeturl',
            name='url',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='twitter_connector.Url'),
        ),
        migrations.AddField(
            model_name='tweet',
            name='urls',
            field=models.ManyToManyField(through='twitter_connector.TweetUrl', to='twitter_connector.Url', verbose_name='urls'),
        ),
        migrations.AddField(
            model_name='hashtagurl',
            name='url',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='twitter_connector.Url'),
        ),
        migrations.AddField(
            model_name='hashtag',
            name='urls',
            field=models.ManyToManyField(through='twitter_connector.HashtagUrl', to='twitter_connector.Url', verbose_name='urls'),
        ),
        migrations.AlterUniqueTogether(
            name='tweeturl',
            unique_together=set([('tweet', 'url')]),
        ),
        migrations.AlterUniqueTogether(
            name='hashtagurl',
            unique_together=set([('url', 'hashtag')]),
        ),
    ]
