text: # Generated by Django 3.2 on 2021-05-04 16:39
  
  import django.core.validators
  from django.db import migrations, models
  import django.db.models.deletion
  import django.utils.timezone
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
      ]
  
      operations = [
          migrations.CreateModel(
              name='Company',
              fields=[
                  ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('name', models.CharField(max_length=255, unique=True, verbose_name='会社名')),
              ],
              options={
                  'db_table': 'company',
              },
          ),
          migrations.CreateModel(
              name='Product',
              fields=[
                  ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('date', models.DateField(default=django.utils.timezone.now, null=True, verbose_name='購入日')),
                  ('name', models.CharField(max_length=255, unique=True, verbose_name='商品名')),
                  ('stock', models.IntegerField(default=0, verbose_name='個数')),
              ],
              options={
                  'db_table': 'product',
              },
          ),
          migrations.CreateModel(
              name='StockControl',
              fields=[
                  ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('date', models.DateField(default=django.utils.timezone.now, verbose_name='日付')),
                  ('count', models.IntegerField(verbose_name='増減')),
                  ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='schedule.company', verbose_name='会社名')),
                  ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='schedule.product', verbose_name='商品名')),
              ],
              options={
                  'db_table': 'stock_control',
              },
          ),
          migrations.CreateModel(
              name='Schedule',
              fields=[
                  ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('date', models.DateField(default=django.utils.timezone.now, verbose_name='日付')),
                  ('area', models.CharField(max_length=100, verbose_name='場所')),
                  ('content', models.CharField(max_length=100, verbose_name='内容')),
                  ('num_of_people', models.IntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1000)], verbose_name='人数')),
                  ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='schedule.company', verbose_name='会社名')),
              ],
              options={
                  'db_table': 'schedule',
              },
          ),
          migrations.CreateModel(
              name='Person',
              fields=[
                  ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('name', models.CharField(max_length=255, verbose_name='名前')),
                  ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='schedule.company', verbose_name='会社名')),
              ],
              options={
                  'db_table': 'person',
              },
          ),
          migrations.CreateModel(
              name='Note',
              fields=[
                  ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('content', models.TextField(verbose_name='メモ')),
                  ('name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='schedule.person', verbose_name='名前')),
              ],
              options={
                  'db_table': 'note',
              },
          ),
          migrations.CreateModel(
              name='Info',
              fields=[
                  ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('date', models.DateField(default=django.utils.timezone.now, verbose_name='日付')),
                  ('content', models.TextField(verbose_name='内容')),
                  ('name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='schedule.person', verbose_name='名前')),
              ],
              options={
                  'db_table': 'info',
              },
          ),
          migrations.AddConstraint(
              model_name='schedule',
              constraint=models.UniqueConstraint(fields=('date', 'company'), name='schedule_unique'),
          ),
          migrations.AddConstraint(
              model_name='person',
              constraint=models.UniqueConstraint(fields=('name', 'company'), name='person_unique'),
          ),
      ]
  