# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-12-06 08:40
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='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('content', models.TextField()),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('type', models.CharField(choices=[('0', 'Notice'), ('1', 'Forum'), ('2', 'FAQ')], default='0', max_length=1)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.CharField(max_length=200)),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='article_comment', to='SNULAR.Article')),
            ],
        ),
        migrations.CreateModel(
            name='GPRecruitment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('min_panel', models.PositiveIntegerField(default=0)),
                ('discounted_price', models.PositiveIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='GPRegister',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('num_panel', models.PositiveIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone_number', models.CharField(max_length=13)),
                ('type', models.CharField(choices=[('0', 'Customer'), ('1', 'Manufacturer'), ('2', 'Admin')], default='0', max_length=1)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='user_profile', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='SolarPanel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('company', models.CharField(max_length=50)),
                ('price', models.PositiveIntegerField(default=0)),
                ('power', models.PositiveIntegerField(default=0)),
                ('width', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('length', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('image', models.ImageField(default='default_image.jpg', upload_to='', verbose_name='Upload image')),
                ('manufacturer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='registered_panel', to='SNULAR.Profile')),
            ],
        ),
        migrations.AddField(
            model_name='gpregister',
            name='customer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='registered_gp', to='SNULAR.Profile'),
        ),
        migrations.AddField(
            model_name='gpregister',
            name='gp_recruitment',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='registered_gp', to='SNULAR.GPRecruitment'),
        ),
        migrations.AddField(
            model_name='gprecruitment',
            name='manufacturer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recruiting_gp', to='SNULAR.Profile'),
        ),
        migrations.AddField(
            model_name='gprecruitment',
            name='solar_panel',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recruiting_gp', to='SNULAR.SolarPanel'),
        ),
        migrations.AddField(
            model_name='comment',
            name='author',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='wrote_comment', to='SNULAR.Profile'),
        ),
        migrations.AddField(
            model_name='article',
            name='author',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='wrote_article', to='SNULAR.Profile'),
        ),
    ]
