Ticket #220 (assigned defect)

Opened 5 years ago

Last modified 4 years ago

Renaming a inherited model makes troubles with foreignkeys

Reported by: anonymous Owned by: andrew
Priority: major Milestone: 1.0
Component: commands Version: 0.6-pre
Keywords: Cc:

Description

If i rename a table that was inherited from an other model there are some issues:

the primary_key changes name
MySQL MyIsam? doesn't allow to rename primary keys
MySQL InnoDB and Postgres have troubles with foreingkey constraints

Change History

comment:1 Changed 5 years ago by andrew

  • Status changed from new to assigned
  • Version set to Mercurial tip
  • Milestone set to 0.7

This will need some interesting fiddling with the backend. Scheduling for 0.7.

comment:2 Changed 5 years ago by Stavros

I got bit by the same bug. In postgres, it should be sufficient to rename any constraints from old_table_* to new_table_*, since any custom constraints aren't likely to clash with new ones if that is renamed.

The bug I hit was that renaming a table and then creating another one with the old name that contained some of the same fields crashed South, since the new constraints had the same names as the old ones.

comment:3 Changed 4 years ago by andrew

  • Milestone changed from 0.7 to 0.7.1

I'm not going to fix the MyISAM bug, since that's more an issue with the database itself, and unlike SQLite's workarounds I'm not sure this one warrants a pile of hacks yet.

Thus, the only thing remaining to fix is the table constraint renaming. That's going to require quite a lot of work, so pushing it up to the next point release.

comment:4 Changed 4 years ago by andrew

  • Milestone changed from 0.7.1 to 0.7.2

comment:5 Changed 4 years ago by andrew

  • Milestone changed from 0.7.2 to 1.0
Note: See TracTickets for help on using tickets.