Modify

Ticket #69 (closed defect: fixed)

Opened 6 years ago

Last modified 3 years ago

add_column with keep_default doesn't work for ForeignKeys

Reported by: nick Owned by: andrew
Priority: major Milestone:
Component: databaseapi Version:
Keywords: Cc:

Description

keep_default needs to handle name => name_id conversion for foreign key columns. At the moment, it breaks with something like:

db.add_column('info_tip', 'cost', models.ForeignKey?(TipCost?, default=1), keep_default=False)

ALTER TABLE [info_tip] ADD [cost_id] int NOT NULL DEFAULT 1; []

ALTER TABLE [info_tip] ALTER COLUMN [cost] int; []

Attachments

Change History

comment:1 Changed 6 years ago by andrew

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

Fixed in [120].

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.