Ticket #183 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

Changing the related model on a ForeignKey does not take care of constraints

Reported by: ck@… Owned by: andrew
Priority: major Milestone: 0.7
Component: migrations Version: 0.6-pre
Keywords: Cc:

Description

Consider this migration:

    def forwards(self, orm):
        
        # Changing field 'Post.poster'
        db.alter_column('jabberboard_post', 'poster_id', models.ForeignKey(orm['auth.User']))
        
    
    
    def backwards(self, orm):
        
        # Changing field 'Post.poster'
        db.alter_column('jabberboard_post', 'poster_id', models.ForeignKey(orm['jabberboard.Profile']))

This does not take care of the foreign key constraint and does pretty much nothing.

Change History

comment:1 Changed 5 years ago by andrew

  • Status changed from new to assigned
  • Milestone set to 0.6

Agreed, something should happen here.

comment:2 Changed 5 years ago by andrew

  • Milestone changed from 0.6 to 0.7

Bumping to 0.7

comment:3 Changed 4 years ago by andrew

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in [4f86714a643e].

Note: See TracTickets for help on using tickets.