|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +from __future__ import unicode_literals |
| 3 | + |
| 4 | +from django.db import migrations, models |
| 5 | + |
| 6 | + |
| 7 | +class Migration(migrations.Migration): |
| 8 | + |
| 9 | + dependencies = [ |
| 10 | + ] |
| 11 | + |
| 12 | + operations = [ |
| 13 | + migrations.CreateModel( |
| 14 | + name='ClosingRules', |
| 15 | + fields=[ |
| 16 | + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
| 17 | + ('start', models.DateTimeField()), |
| 18 | + ('end', models.DateTimeField()), |
| 19 | + ('reason', models.TextField(null=True, blank=True)), |
| 20 | + ], |
| 21 | + options={ |
| 22 | + 'verbose_name': 'Closing Rule', |
| 23 | + 'verbose_name_plural': 'Closing Rules', |
| 24 | + }, |
| 25 | + ), |
| 26 | + migrations.CreateModel( |
| 27 | + name='Company', |
| 28 | + fields=[ |
| 29 | + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
| 30 | + ('name', models.CharField(max_length=100)), |
| 31 | + ('slug', models.SlugField(unique=True)), |
| 32 | + ('logo', models.FileField(null=True, upload_to=b'logo', blank=True)), |
| 33 | + ], |
| 34 | + options={ |
| 35 | + 'verbose_name': 'Company', |
| 36 | + 'verbose_name_plural': 'Companies', |
| 37 | + }, |
| 38 | + ), |
| 39 | + migrations.CreateModel( |
| 40 | + name='OpeningHours', |
| 41 | + fields=[ |
| 42 | + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
| 43 | + ('weekday', models.IntegerField(choices=[(1, 'Monday'), (2, 'Tuesday'), (3, 'Wednesday'), (4, 'Thursday'), (5, 'Friday'), (6, 'Saturday'), (7, 'Sunday')])), |
| 44 | + ('from_hour', models.TimeField()), |
| 45 | + ('to_hour', models.TimeField()), |
| 46 | + ('company', models.ForeignKey(to='openinghours.Company')), |
| 47 | + ], |
| 48 | + options={ |
| 49 | + 'verbose_name': 'Opening Hour', |
| 50 | + 'verbose_name_plural': 'Opening Hours', |
| 51 | + }, |
| 52 | + ), |
| 53 | + migrations.AddField( |
| 54 | + model_name='closingrules', |
| 55 | + name='company', |
| 56 | + field=models.ForeignKey(to='openinghours.Company'), |
| 57 | + ), |
| 58 | + ] |
0 commit comments