class AppAModel(models.Model):
class AppBModel(models.Model): name = models.CharField(max_length=50, default="")
class AppCModel(models.Model): my_field = models.ForeignKey(AppAModel, on_delete=models.CASCADE)
class Migration(migrations.Migration):
dependencies = [ ('app_a', 'XXXX_app_a_migration'), ('app_c', 'XXXX_app_c_migration'), ]
operations = [ migrations.CreateModel( name='AppCModel', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('my_field', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ncm.AppAModel')), ], ), ]
class Migration(migrations.Migration):
dependencies = [ ('app_c', 'XXXX_app_c_migration'), ]
operations = [ migrations.AlterField( model_name='appcmodel', name='my_field', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='metals.AppBModel'), ), ]
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/48ab3732-f667-472f-a678-ca9f082315da%40googlegroups.com.
When you make any changes to the field, AlterField will be added rather than AddField.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/48ab3732-f667-472f-a678-ca9f082315da%40googlegroups.com.