summaryrefslogtreecommitdiff
path: root/web_interface/drinks/migrations/0001_initial.py
blob: 3157493abffaa8c017e0ae39b9c0429c598969ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Generated by Django 5.2.9 on 2025-12-07 21:51

import colorfield.fields
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(help_text='First name of the author of a drink', verbose_name='First name')),
                ('last_name', models.CharField(help_text='Last name of the author of a drink', verbose_name='Last name')),
            ],
        ),
        migrations.CreateModel(
            name='Bottle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Name of the type bottle. e.g. Coca Cola, *Specific Whiskey*', verbose_name='Bottle')),
                ('description', models.TextField(blank=True, help_text='Free text field that will be shown to the users', verbose_name='Description')),
                ('picture', models.ImageField(blank=True, help_text='A picture for the overview', upload_to='', verbose_name='Picture')),
                ('color', colorfield.fields.ColorField(blank=True, default='', help_text='Color of the drink, used in the UI', image_field='picture', max_length=25, samples=None, verbose_name='Color')),
            ],
        ),
        migrations.CreateModel(
            name='Drink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Name of the drink, for displaying in overview', verbose_name='Name')),
                ('description', models.TextField(blank=True, help_text='Free text field that will be shown to the users', verbose_name='Description')),
                ('picture', models.ImageField(blank=True, help_text='A picture for the overview', upload_to='', verbose_name='Picture')),
                ('author', models.ForeignKey(blank=True, help_text='Author of the drink', null=True, on_delete=django.db.models.deletion.CASCADE, to='drinks.author', verbose_name='Author')),
            ],
        ),
        migrations.CreateModel(
            name='Unit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('abbreviation', models.CharField(help_text='E.g: ml.', verbose_name='Abbreviation')),
                ('name', models.CharField(blank=True, help_text='E.g: ml.', verbose_name='Name')),
                ('pump_time', models.FloatField(blank=True, help_text='Amount of time to run the pump for to dispence 1 of these units', verbose_name='Pump time')),
                ('valve_time', models.FloatField(blank=True, help_text='Amount of time to run the pump for to dispence 1 of these units', verbose_name='Pump time')),
            ],
            options={
                'constraints': [models.CheckConstraint(condition=models.Q(('pump_time__isnull', False), ('valve_time__isnull', False), _connector='OR'), name='one_of_valve_time_or_pump_time_must_be_filled')],
            },
        ),
        migrations.CreateModel(
            name='Ingredient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.IntegerField(help_text='In conjunction with unit it is an absolute amount', verbose_name='Amount')),
                ('bottle', models.ForeignKey(help_text="This ingredient's bottle", on_delete=django.db.models.deletion.CASCADE, to='drinks.bottle', verbose_name='Bottle')),
                ('drink', models.ForeignKey(help_text='The drink this ingredient is part of', on_delete=django.db.models.deletion.CASCADE, to='drinks.drink', verbose_name='Drink')),
                ('unit', models.ForeignKey(help_text='The unit that the ammount is messured in, e.g. ml.', on_delete=django.db.models.deletion.CASCADE, to='drinks.unit', verbose_name='Unit')),
            ],
        ),
    ]