<reponame>cristianrcv/awesome-recipes<filename>recipes/migrations/0001_initial.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-20 14:18
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'course',
                'verbose_name_plural': 'courses',
            },
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('document', models.ImageField(upload_to=recipes.models.user_directory_path)),
                ('uploaded_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'image',
                'verbose_name_plural': 'images',
            },
        ),
        migrations.CreateModel(
            name='Ingredient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.PositiveSmallIntegerField()),
                ('units', models.CharField(choices=[('u', 'unit'), ('g', 'gram'), ('kg', 'kilogram'), ('l', 'liter'), ('dl', 'dl'), ('ml', 'ml'), ('cm3', 'cm3'), ('dm3', 'dm3'), ('tbsp', 'tablespoon'), ('tsp', 'teaspoon')], default='1', max_length=15)),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'ingredient',
                'verbose_name_plural': 'ingredients',
            },
        ),
        migrations.CreateModel(
            name='Keyword',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'keyword',
                'verbose_name_plural': 'keywords',
            },
        ),
        migrations.CreateModel(
            name='RawMaterial',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'raw material',
                'verbose_name_plural': 'raw materials',
            },
        ),
        migrations.CreateModel(
            name='Recipe',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100, unique=True, verbose_name='title')),
                ('elaboration_time', models.PositiveSmallIntegerField()),
                ('elaboration_time_units', models.CharField(choices=[('h', 'hour'), ('min', 'minute')], default='1', max_length=10)),
                ('num_rations', models.PositiveSmallIntegerField()),
                ('elaboration', models.TextField(blank=True, verbose_name='elaboration')),
                ('is_public', models.BooleanField(default=True, verbose_name='public')),
                ('date_created', models.DateTimeField(verbose_name='date created')),
                ('date_updated', models.DateTimeField(verbose_name='date updated')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recipes', to='recipes.Course', verbose_name='course')),
                ('keywords', models.ManyToManyField(blank=True, to='recipes.Keyword')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recipes', to=settings.AUTH_USER_MODEL, verbose_name='owner')),
            ],
            options={
                'ordering': ['title'],
                'verbose_name': 'recipe',
                'verbose_name_plural': 'recipes',
            },
        ),
        migrations.AddField(
            model_name='ingredient',
            name='name',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='used_in', to='recipes.RawMaterial', verbose_name='material'),
        ),
        migrations.AddField(
            model_name='ingredient',
            name='recipe',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ingredients', to='recipes.Recipe', verbose_name='used_in'),
        ),
        migrations.AddField(
            model_name='image',
            name='recipe',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='images', to='recipes.Recipe', verbose_name='used_in'),
        ),
    ]

# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-20 14:18
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'course',
                'verbose_name_plural': 'courses',
            },
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('document', models.ImageField(upload_to=recipes.models.user_directory_path)),
                ('uploaded_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'image',
                'verbose_name_plural': 'images',
            },
        ),
        migrations.CreateModel(
            name='Ingredient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.PositiveSmallIntegerField()),
                ('units', models.CharField(choices=[('u', 'unit'), ('g', 'gram'), ('kg', 'kilogram'), ('l', 'liter'), ('dl', 'dl'), ('ml', 'ml'), ('cm3', 'cm3'), ('dm3', 'dm3'), ('tbsp', 'tablespoon'), ('tsp', 'teaspoon')], default='1', max_length=15)),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'ingredient',
                'verbose_name_plural': 'ingredients',
            },
        ),
        migrations.CreateModel(
            name='Keyword',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'keyword',
                'verbose_name_plural': 'keywords',
            },
        ),
        migrations.CreateModel(
            name='RawMaterial',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'raw material',
                'verbose_name_plural': 'raw materials',
            },
        ),
        migrations.CreateModel(
            name='Recipe',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100, unique=True, verbose_name='title')),
                ('elaboration_time', models.PositiveSmallIntegerField()),
                ('elaboration_time_units', models.CharField(choices=[('h', 'hour'), ('min', 'minute')], default='1', max_length=10)),
                ('num_rations', models.PositiveSmallIntegerField()),
                ('elaboration', models.TextField(blank=True, verbose_name='elaboration')),
                ('is_public', models.BooleanField(default=True, verbose_name='public')),
                ('date_created', models.DateTimeField(verbose_name='date created')),
                ('date_updated', models.DateTimeField(verbose_name='date updated')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recipes', to='recipes.Course', verbose_name='course')),
                ('keywords', models.ManyToManyField(blank=True, to='recipes.Keyword')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recipes', to=settings.AUTH_USER_MODEL, verbose_name='owner')),
            ],
            options={
                'ordering': ['title'],
                'verbose_name': 'recipe',
                'verbose_name_plural': 'recipes',
            },
        ),
        migrations.AddField(
            model_name='ingredient',
            name='name',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='used_in', to='recipes.RawMaterial', verbose_name='material'),
        ),
        migrations.AddField(
            model_name='ingredient',
            name='recipe',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ingredients', to='recipes.Recipe', verbose_name='used_in'),
        ),
        migrations.AddField(
            model_name='image',
            name='recipe',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='images', to='recipes.Recipe', verbose_name='used_in'),
        ),
    ]
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-09-20 14:18