text: # Generated by Django 3.1.14 on 2022-01-26 18:35
  
  import django.core.validators
  from django.db import migrations, models
  import django.db.models.deletion
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
          ('coupons', '0001_initial'),
          ('store', '0001_initial'),
      ]
  
      operations = [
          migrations.CreateModel(
              name='Order',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('first_name', models.CharField(max_length=100, verbose_name='Imię')),
                  ('last_name', models.CharField(max_length=100, verbose_name='Nazwisko')),
                  ('email', models.EmailField(max_length=254, verbose_name='E-mail')),
                  ('address', models.CharField(max_length=500, verbose_name='Adres')),
                  ('postal_code', models.CharField(max_length=30, verbose_name='Kod pocztowy')),
                  ('city', models.CharField(max_length=200, verbose_name='Miejscowość')),
                  ('nip', models.CharField(max_length=10, verbose_name='NIP')),
                  ('company_name', models.CharField(max_length=255, verbose_name='Nazwa Firmy')),
                  ('company_postal_code', models.CharField(max_length=255, verbose_name='Kod pocztowy Firmy')),
                  ('company_city', models.CharField(max_length=255, verbose_name='Miejscowość Firmy')),
                  ('company_address', models.CharField(max_length=255, verbose_name='Adres Firmy')),
                  ('created', models.DateTimeField(auto_now_add=True, verbose_name='Utworzono')),
                  ('updated', models.DateTimeField(auto_now=True, verbose_name='Zmodyfikowano')),
                  ('paid', models.BooleanField(default=False, verbose_name='Zapłacono')),
                  ('braintree_id', models.CharField(blank=True, max_length=150, verbose_name='Braintree_id')),
                  ('discount', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100)], verbose_name='Zniżka')),
                  ('coupon', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='orders', to='coupons.coupon')),
              ],
              options={
                  'ordering': ('-created',),
              },
          ),
          migrations.CreateModel(
              name='OrderItem',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Cena')),
                  ('quantity', models.PositiveIntegerField(default=1, verbose_name='Ilość')),
                  ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='orders.order')),
                  ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_items', to='store.product')),
              ],
          ),
      ]
  