# Generated by Django 2.2 on 2019-05-03 12:56

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='Banner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text_info', models.CharField(default='', max_length=50, verbose_name='標題')),
                ('img', models.ImageField(upload_to='banner/', verbose_name='輪播圖')),
                ('link_url', models.URLField(max_length=100, verbose_name='圖片鏈接')),
                ('is_active', models.BooleanField(default=False, verbose_name='是否是active')),
            ],
            options={
                'verbose_name': '輪播圖',
                'verbose_name_plural': '輪播圖',
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='分類')),
                ('index', models.IntegerField(default=999, verbose_name='分類排序')),
            ],
            options={
                'verbose_name': '分類',
                'verbose_name_plural': '分類',
            },
        ),
        migrations.CreateModel(
            name='Link',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='連結名稱')),
                ('linkurl', models.URLField(max_length=100, verbose_name='網址')),
            ],
            options={
                'verbose_name': '友站連結',
                'verbose_name_plural': '友站連結',
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='文章標籤')),
            ],
            options={
                'verbose_name': '文章標籤',
                'verbose_name_plural': '文章標籤',
            },
        ),
        migrations.CreateModel(
            name='Tui',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='推薦位')),
            ],
            options={
                'verbose_name': '推薦位',
                'verbose_name_plural': '推薦位',
            },
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=70, verbose_name='標題')),
                ('excerpt', models.TextField(blank=True, max_length=200, verbose_name='摘要')),
                ('img', models.ImageField(blank=True, null=True, upload_to='article_img/%Y/%m/%d/', verbose_name='文章圖片')),
                ('body', models.TextField()),
                ('views', models.PositiveIntegerField(default=0, verbose_name='瀏覽次數')),
                ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='發佈時間')),
                ('modified_time', models.DateTimeField(auto_now=True, verbose_name='修改時間')),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='blog.Category', verbose_name='分類')),
                ('tags', models.ManyToManyField(blank=True, to='blog.Tag', verbose_name='標籤')),
                ('tui', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='blog.Tui', verbose_name='推薦位')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='作者')),
            ],
            options={
                'verbose_name': '文章',
                'verbose_name_plural': '文章',
            },
        ),
    ]
