# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-26 06:38
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category_name', models.CharField(max_length=100)),
            ],
            options={
                'ordering': ('category_name',),
            },
        ),
        migrations.CreateModel(
            name='posts_tags',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tag_name', models.CharField(max_length=100)),
            ],
            options={
                'ordering': ('tag_name',),
            },
        ),
        migrations.RemoveField(
            model_name='categories',
            name='category',
        ),
        migrations.RemoveField(
            model_name='tags',
            name='posts',
        ),
        migrations.RemoveField(
            model_name='post',
            name='category',
        ),
        migrations.AlterField(
            model_name='post',
            name='content',
            field=models.TextField(),
        ),
        migrations.DeleteModel(
            name='categories',
        ),
        migrations.DeleteModel(
            name='tags',
        ),
        migrations.AddField(
            model_name='tag',
            name='posts',
            field=models.ManyToManyField(through='users_app.posts_tags', to='users_app.post'),
        ),
        migrations.AddField(
            model_name='posts_tags',
            name='post_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users_app.post'),
        ),
        migrations.AddField(
            model_name='posts_tags',
            name='tag_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users_app.tag'),
        ),
        migrations.AddField(
            model_name='post',
            name='post_category',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='users_app.category'),
            preserve_default=False,
        ),
    ]
