Ticket #1151 (closed enhancement: invalid)

Opened 3 years ago

Last modified 3 years ago

Add add_foreign_key to the database API

Reported by: valtron2000@… Owned by: andrew
Priority: trivial Milestone:
Component: databaseapi Version: 0.7.6
Keywords: Cc:


Right now I'm using db.execute(db.foreign_key_sql(...)), but it's not proper since foreign_key_sql isn't documented anywhere.

Change History

comment:1 Changed 3 years ago by andrew

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

I don't exactly get what bug this is - South adds new ForeignKeys? just fine using the main add field interface, and if it's altering of foreign keys then you want #1073. Closing.

comment:2 Changed 3 years ago by valtron2000@…

The reason I needed this was because of tables that were initially created as MyISAM and later converted to InnoDB. I could have added the foreign keys by hand, but it was faster to do it with south.

comment:3 Changed 3 years ago by andrew

Ah, right. That case is a very peculiar speciality of MySQL storage engines, though - adding a FK constraint outside of adding a field is not something South is really planned for, so I'm happy leaving it like it is (and surprised it's a one-liner)

Note: See TracTickets for help on using tickets.