# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-01-16 01:26
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Cookbook',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('c_image', models.FileField(upload_to='cookbook/')),
                ('for_people_num', models.SmallIntegerField(default=0)),
                ('duration', models.PositiveSmallIntegerField(default=0)),
                ('like', models.PositiveSmallIntegerField(default=0)),
                ('click_freq', models.IntegerField(default=0)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('update_time', models.DateTimeField(auto_now=True)),
                ('is_valid', models.BooleanField(default=False)),
                ('state', models.SmallIntegerField(choices=[(0, '儲存'), (1, '發布')], default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('cookbook', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='recipe.Cookbook')),
            ],
        ),
        migrations.CreateModel(
            name='Ingredient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=15)),
                ('quantity', models.CharField(max_length=10)),
                ('cookbook', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='recipe.Cookbook')),
                ('group', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.PROTECT, to='recipe.Group')),
            ],
        ),
        migrations.CreateModel(
            name='MessageBoard',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.FileField(blank=True, null=True, upload_to='comment')),
                ('message', models.TextField(max_length=400)),
            ],
        ),
        migrations.CreateModel(
            name='Step',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('s_image', models.FileField(blank=True, null=True, upload_to='step/')),
                ('description', models.TextField(max_length=150)),
                ('tips', models.TextField(blank=True, max_length=200, null=True)),
                ('cookbook', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='recipe.Cookbook')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('reg_id', models.CharField(max_length=50, unique=True)),
                ('email', models.EmailField(blank=True, default='', max_length=254, null=True)),
                ('email_is_verify', models.BooleanField(default=False)),
                ('name', models.CharField(blank=True, max_length=20, null=True)),
                ('gender', models.PositiveSmallIntegerField(blank=True, null=True)),
                ('privilege', models.PositiveSmallIntegerField(blank=True, null=True)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('updated_time', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('object', django.db.models.manager.Manager()),
            ],
        ),
        migrations.AddField(
            model_name='messageboard',
            name='created_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='message_created', to='recipe.User'),
        ),
        migrations.AddField(
            model_name='cookbook',
            name='created_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='cookbook_created', to='recipe.User'),
        ),
    ]
