Changes between Initial Version and Version 3 of Ticket #30691
- Timestamp:
- Aug 9, 2019, 9:13:08 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30691
- Property Component Uncategorized → Migrations
- Property Triage Stage Unreviewed → Accepted
- Property Version 2.2 → master
- Property Owner changed from to
- Property Status new → assigned
-
Ticket #30691 – Description
initial v3 7 7 # TestApp1(models.py): 8 8 9 {{{#!python 9 10 class App1(models.Model): 10 11 id = models.UUIDField(primary_key=True, unique=True, default=uuid.uuid4, editable=False, verbose_name=_('identifier')) 11 12 text = models.CharField(max_length=100, verbose_name=_('text')) 12 13 another_app = models.UUIDField(null=True, blank=True, verbose_name=_('another app')) 14 }}} 13 15 14 16 # TestApp2(models.py): 15 17 18 {{{#!python 16 19 class App2(models.Model): 17 20 id = models.UUIDField(primary_key=True, unique=True, default=uuid.uuid4, editable=False, verbose_name=_('identifier')) 18 21 text = models.CharField(max_length=100, verbose_name=_('text')) 22 }}} 19 23 20 24 First model named "App1" has UUID field named "another_app": 21 25 22 - another_app = models.UUIDField(null=True, blank=True, verbose_name=_('another app'))26 - `another_app = models.UUIDField(null=True, blank=True, verbose_name=_('another app'))` 23 27 24 28 After some time i change field from UUID to FK, like this: 25 29 26 - another_app = models.ForeignKey(App2, null=True, blank=True, on_delete=models.SET_NULL, verbose_name=_('another app'))30 - `another_app = models.ForeignKey(App2, null=True, blank=True, on_delete=models.SET_NULL, verbose_name=_('another app'))` 27 31 28 32 And as result i create new migration, but Migration class was unexpected result, because it does not create any "dependencies" for App2, because of FK.