# -*- coding: utf-8 -*-
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('notes', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('name', models.CharField(max_length=20)),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('owner', models.ForeignKey(related_name='folders', to=settings.AUTH_USER_MODEL,on_delete=models.CASCADE)),
                ('parent', models.ForeignKey(null=True, related_name='children', to='notes.Group',on_delete=models.CASCADE)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
                ('name', models.CharField(max_length=20)),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('owner', models.ForeignKey(to=settings.AUTH_USER_MODEL,on_delete=models.CASCADE)),
            ],
        ),
        migrations.AddField(
            model_name='note',
            name='is_public',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='note',
            name='last_read',
            field=models.DateTimeField(null=True, auto_now=True),
        ),
        migrations.AddField(
            model_name='note',
            name='vote',
            field=models.IntegerField(default=0),
        ),
        migrations.AddField(
            model_name='note',
            name='group',
            field=models.ForeignKey(default=1, related_name='notes', to='notes.Group',on_delete=models.CASCADE)),
        
        migrations.AddField(
            model_name='note',
            name='tags',
            field=models.ManyToManyField(related_name='notes', to='notes.Tag'),
        ),
    ]
