django-rest-framework/tests/issue/migrations/0001_initial.py

43 lines
1.4 KiB
Python

# Generated by Django 3.1.13 on 2022-01-23 09:00
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=10)),
],
),
migrations.CreateModel(
name='ItemAmount',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('amount', models.IntegerField()),
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='issue.item')),
],
),
migrations.CreateModel(
name='Summary',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('items', models.ManyToManyField(through='issue.ItemAmount', to='issue.Item')),
],
),
migrations.AddField(
model_name='itemamount',
name='summary',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='issue.summary'),
),
]