Changes between Initial Version and Version 1 of Ticket #32742, comment 1


Ignore:
Timestamp:
May 12, 2021, 4:02:44 AM (3 years ago)
Author:
greemo

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32742, comment 1

    initial v1  
    1 Hmm, looks like this has to do with the use of django polymorphic. Somehow the foreign keys here are not getting updated.
     1Hmm, looks like this has to do with the use of django polymorphic.
     2
     3Somehow the foreign keys here are not getting updated.
     4{{{
     5class JuntagricoBasePoly(PolymorphicModel):
     6
     7    class Meta:
     8        abstract = True
     9
     10class Billable(JuntagricoBasePoly):
     11    ...
     12
     13class Subscription(Billable, SimpleStateModel):
     14    ...
     15
     16class SubscriptionMembership(JuntagricoBaseModel):
     17    member = models.ForeignKey('Member', on_delete=models.CASCADE)
     18    subscription = models.ForeignKey('Subscription', db_constraint=False, on_delete=models.CASCADE)
     19    ...
     20}}}
     21
     22Error received when running migration
     23{{{
     24MySQLdb._exceptions.OperationalError: (1833, "Cannot change column 'billable_ptr_id': used in a foreign key constraint 'juntagrico_subscript_subscription_id_1f724c85_fk_juntagric' of table 'juntagrico.juntagrico_subscriptionmembership'")
     25}}}
     26
     27}}}
Back to Top