Skip to content

Instantly share code, notes, and snippets.

@specialunderwear
Last active April 22, 2019 13:21
Show Gist options
  • Save specialunderwear/fc73e5aa30219294e631c2e24c0894f9 to your computer and use it in GitHub Desktop.
Save specialunderwear/fc73e5aa30219294e631c2e24c0894f9 to your computer and use it in GitHub Desktop.
# Generated by Django 2.2 on 2019-04-22 11:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('through', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ThroughFooBars',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('foo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='through.Foo')),
('bar', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='through.Bar')),
('order', models.PositiveIntegerField(default=0)),
],
options={
'db_table': 'through_foo_bars',
'unique_together': (('foo', 'bar'),),
'ordering': ('order',),
},
),
migrations.AlterField(
model_name='foo',
name='bars',
field=models.ManyToManyField(through='through.ThroughFooBars', to='through.Bar'),
),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment