Modify ↓
Ticket #69 (closed defect: fixed)
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
Note: See
TracTickets for help on using
tickets.

Fixed in [120].