jazzband / django-redshift-backend

Redshift database backend for Django
Apache License 2.0
83 stars 47 forks source link

Fix: fix constraint creation using the wrong table and column name #118

Closed BlueMagma2 closed 4 months ago

BlueMagma2 commented 9 months ago

Subject: Fix a bug regarding foreign key constraint creation

Feature or Bugfix

Detail

eg.

Table1(models.Model):
    remote_column = models.IntegerField(unique=True)

Table2(models.Model):
    local_column = models.ForeignKey(to=Table1, to_field='remote_column')

During the migrations, you would get an error saying Table2 doesn't have a column named remote_column which is absurd since that colum is not supposed to be in that table.

BlueMagma2 commented 9 months ago

@shimizukawa I see you merged the last PR, though I admit it was some time ago. Can you have a look ?

PS: I apologise for pinging you if you are the wrong person to address this

BlueMagma2 commented 3 months ago

Ha cool, I'm happy to see this was merged, thanks you