# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-16 17:52
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Categoria',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre_cat', models.CharField(max_length=150)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comentario', models.TextField()),
                ('fechacomment', models.DateTimeField(auto_now_add=True)),
                ('autorcomment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='usuarios_comment', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('titulo', models.CharField(max_length=120)),
                ('fechal', models.DateTimeField(auto_now_add=True)),
                ('contenido', models.TextField()),
                ('imagen', models.ImageField(blank=True, upload_to='post-images')),
                ('autor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='usuarios_post', to=settings.AUTH_USER_MODEL)),
                ('categoria', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='es_de_categoria', to='post.Categoria')),
            ],
        ),
        migrations.AddField(
            model_name='comment',
            name='posteado',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posteado_a', to='post.Post'),
        ),
    ]
